How-to: Non-Linear Navigation in Captivate Using rdcmndGotoSlide

 

Yes, it does work now. As many of you who have read my other posts on the subject of Captivate know, I often use a Flash ‘wrapper’ that contains custom navigation controls for controlling loaded Captivate movies. This was an absolute necessity prior to Captivate 2.0, as the navigation bars in Captivate 1.0 and RoboDemo were….ahem….a little too unprofessional looking to me. You know, like those hip ’skinz’ that the kids come up with for skinning Windows Media Player, or WinAmp, etc. Orange and blue, lime green and flourescent purple, etc. Captivate 3 has some decent navigation controls but they are intra-movie. Yeah, there is a ‘menu’ type thing in Captivate but it’s even more useless than the one they had in previous versions. Well, without further digression, here you go:

Click here to view the example swf.

There are three things you must know to use this variable:

  1. The slide numbers are based on their index number in the array that Captivate uses internally to keep track of them, and thus, they are zero-based. Just like actionscript arrays. So slide 1 is really slide 0 to Captivate.
  2. If you simply use the rdcmndGotoSlide variable to jump to a specific slide, it’ll do it. But the movie will be paused. The rdcmndGotoSlide variable should really be named rdcmndGotoSlideAndPause : ) You can see it in the code sample here, taken from one of the buttons:

    /***********************************************
    * Jumps the Captivate Movie to Slide 3, pauses, then resumes
    ***********************************************/
    three_btn.onRelease = function() {
    myLoader_cld.content.rdcmndGotoSlide = 2; //zero-based array
    myLoader_cld.content.rdcmndPause = 1;
    myLoader_cld.content.rdcmndResume = 1;
    }

  3. The problem is, just like in a previous post where I ran into this same scenario, you have to programmatically pause it, even though it’s already paused, in order for the Resume variable to work. I can see how this would be the case as it’s not like the Captivate programmers (or should I say RoboDemo programmers?) were anticipating people using this variable since they have never documented it.

Hopefully, this opens up some new possibilities for you. I am currently in the process of working on an xml-based navigation menu that uses this same variable in order to provide a quick, elegant, and very flexible way for loading/unloading multiple Captivate movies.

This entry was posted in Captivate, Flash and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

 

10 Comments

  1. Thorsten
    Posted August 14, 2008 at 5:20 pm | Permalink

    Hi Mark,
    i’m just trying to implement a player for captivate swf files with FlexBuilder 3. The captivate skin menu does not work correct inside the flex SWFLoader component. Perhaps you can help me with a working flex code snippet where a captivate swf file is called and a rdcmndGotoSlide command is doing its job. This would be a great help for me.
    Greetings from Frankfurt, Germany
    Thorsten

  2. Posted August 18, 2008 at 2:43 pm | Permalink

    Hi Thorsten,

    Unfortunately I keep saying to myself for a year now that I am going to stop taking on any more ActionScript 2.0 development projects and concentrate solely on AS3 (and mostly Flex, since it is a way more sensible way to develop in for the projects I do, than in the Flash IDE). But, the types of freelance projects I get are all still best served in AS2/Flash Player 8 so I’ve not done much with Flex in a while.

    That said…the problem you’re having is that an AVM2 SWF (ie, one written in AS3) can’t communicate directly with an AVM1 SWF (which is all that Captivate 3 can publish to). There are some workarounds. Check out the pipwerks blog – he has some references to it. Also, the “Learning Actionscript 3.0″ book by Rich Shupe has a section that discusses this very problem.

    I wrote about this a while back. Do a search of my blog and you’ll find an article that talks about this subject, probably with some direct links to a solution.

    mark

  3. Duke
    Posted October 28, 2008 at 2:46 pm | Permalink

    Hi Mark,

    I would like to have a ‘replay’ button on my slides. Could you point me in the right direction on how to do this using a flash button and action script?
    Something like:
    /***********************************************
    *Replays current Slide
    ***********************************************/
    three_btn.onRelease = function() {
    myLoader_cld.content.rdcmndGotoSlide = rdinfoCurrentSlide;
    myLoader_cld.content.rdcmndPause = 1;
    myLoader_cld.content.rdcmndResume = 1;
    }

  4. Posted October 28, 2008 at 8:01 pm | Permalink

    Just use something like:

    replay_btn.onRelease = function()
    {
    myCaptivateMovie.rdcmndGotoSlide = 1;
    }

    Also – if you need an automatic replay (ie, without a button), do a search of the archives in my blog (just click on the ‘Captivate’ category) – a while back someone sent some code which I posted on how to ‘loop’ a Captivate movie (via actionscript, not the CP publishing GUI).

    Marks last blog post..T-Mobile@Home Monthly Bill – How Much It Really Costs (Me)

  5. Duke
    Posted October 29, 2008 at 11:19 am | Permalink

    Hi Mark,

    Thanks for the pointer, however I am looking for code that would replay the currently viewed slide, not the entire movie. Hence my hacked version of your example. Is this at all possible?

    Thanks again.

  6. Posted October 29, 2008 at 11:23 am | Permalink

    Did you try the gotoSlide method and for the argument to it pass the current slide’s number? (to make it portable there may be a currentSlide variable of some sort that you could pass – I don’t recall. Just do a search in the CP doc or look in this blog’s archives for a list of all of the variables).

    mark

    Marks last blog post..T-Mobile@Home Monthly Bill – How Much It Really Costs (Me)

  7. Duke
    Posted October 29, 2008 at 2:49 pm | Permalink

    Hi,

    Turns out it was easier than I thought. Just created a flash button with actionscript:

    on (release) {
    _root.rdcmndGotoSlide = _root.rdinfoCurrentSlide;
    _root.rdcmndPause = 1;
    _root.rdcmndResume = 1;
    }

    Works like a charm, sweet!

    Thanks,
    Duke

  8. Posted October 29, 2008 at 3:19 pm | Permalink

    Cool. I’d be careful using the _root reference (by using it your cp swf’s are no longer portable), but if it suits your needs then congrats!

    Marks last blog post..T-Mobile@Home Monthly Bill – How Much It Really Costs (Me)

  9. Duke
    Posted November 27, 2008 at 3:39 pm | Permalink

    Hi,
    My next challenge has presented itself ;-) I need a solution for a ‘back’ button that can span multiple SWF’s in a daisy chained project.

    Ergo, clicking back on the first slide in SWF2 would load the last slide of SWF1
    Is this something that can be done?

    Thanks,
    Duke

  10. Posted November 27, 2008 at 10:33 pm | Permalink

    Hi Duke,

    This is certainly doable. I’ve done this for projects in the past but it’s been a while. But basically, the steps would be (via actionscript):

    1. If current slide is first slide (or alternatively, if !previous slide), load the previous swf (you’ll need to store references to the swf’s, in their order, either in an xml file or just in an array. Then, whenever a new swf is loaded you can just set a variable like, currentMovie with the index to the currently loaded swf.

    2. Once the onLoad event is fired and you’re sure the previous swf has loaded, you can then use the captivate variables to jump to the last slide.

    mark

    Marks last blog post..Adobe MAX 2008: My Most Memorable Takeaway…By Far!

One Trackback

  1. [...] How-to: Non-Linear Navigation in Captivate Using rdcmndGotoSlide [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

Subscribe without commenting