Setting the rdcmndGotoFrameAndResume variable on a Captivate SWF

 

I just completed a project in which a custom flash wrapper was used for navigation, where the captivate swf’s are loaded in dynamically via an xml-based navigation setup and into an empty movieclip.

Because the client needed their navigation menu links to target specific frames in particularly long Captivate swf’s, I had to use the rdcmndGotoFrameAndResume variable which I had never had to use before. Frankly, I never bothered using any of the ‘frame-based’ variables before because I never needed to - you really shouldn’t ever have a Captivate swf that is so long that you need to do that. It’s best to modularize everything into individual swf files that are more granular. It’s more flexible and easier to maintain that way. But…back to my point -

I ran into a problem where I banged my head against the wall for 2 hours trying to figure out why this code wasn’t working:

contentContainer_mc.rdcmndGotoFrameAndResume = evt.target.selectedNode.attributes.frame; //the target frame was stated in the XML file…pretty slick actually

There was more to it of course but basically, when the user clicked on particular links in the navigation tree menu, I needed the currently loaded Captivate swf’s playhead to go to the specific frame stated in the XML file’s ‘frame’ attribute.

The result at first (and for 2 hours!), no matter what I tried, was that the playhead would go to the intended frame as hoped, but it would be paused. It wouldn’t ‘resume’ playing. Since there is no ‘rdcmndPlay’ variable I tried rdcmndResume every which way possible. No luck.

Then I stopped, took a breath, and figured it out. You have to insert a pause BEFORE the resume command is issued! Makes sense, but shouldn’t they just have a rdcmndGotoAndPlay variable? These variables are nuts.

So the working solution:

contentContainer_mc.rdcmndPause = 1;
contentContainer_mc.rdcmndGotoFrameAndResume = evt.target.selectedNode.attributes.frame;
contentContainer_mc.rdcmndResume = 1;

Now here’s what’s interesting - the rdcmndGotoFrameAndResume, before I came up with the above solution, was acting like a toggle - so if I clicked on a nav link it would go to the targeted frame but be paused. If I clicked on it again, it would resume playing. Strange? Or am I just too burned out from editing so many crap html sites the past 2 months….

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

 

12 Comments

  1. Posted March 15, 2008 at 1:26 am | Permalink

    Forgot to mention - why in the world did the RoboDemo guys (who coded the variables into the product in the first place) not add a ‘rdcmndGotoSlide’ variable? Would make things much simpler I would think.

  2. Posted March 27, 2008 at 2:51 am | Permalink

    nice work, bro

  3. Clayton
    Posted April 22, 2008 at 1:30 pm | Permalink

    Mark,

    There is such a variable by that exact name - and it does work. I found it while effectively decompiling Captivate swf files, as we have discussed. Try it in your programs:

    contentContainer_ms.rdcmndGotoSlide = 5 (e.g.)

    The problem I am having, is that it does not work when my custom player is speaking to a Captivate swf parked on a question slide - nor does RewindAndStop (or play), nor does Previous. I have been working hard to find an answer - Adobe forums are not much help for this level of technical question.

    There is some variable that “locks” captivate swf commands from exectuting when the question is up, and, once played, the questions cannot be played again without unloading and reloading the swf.

    Do you have any ideas? I will post if I find something.

  4. Omid
    Posted April 22, 2008 at 5:25 pm | Permalink

    Thanks , Very Very useful

  5. Posted June 9, 2008 at 10:44 am | Permalink

    Clayton,

    I and others have tried getting this infamous ‘rdcmndGotoSlide’ variable that you mention as existing to work, but to date I have never been able to get it to work and others have emailed me saying it doesn’t work. If you did get it to work please zip up a working example and send to me. I would love to see it and will post it (with credit to you of course) so others can see how it works.

    mark

  6. Marco Gaspar
    Posted June 25, 2008 at 1:49 pm | Permalink

    Hello everyone!
    Anyone has the answer to Mark’s question?
    I’m having the same problem, when I use the “rdcmndGotoSlide” function in a Captivate work that has one question slide, the Captivate can’t jump to a next slide (after the quiz)

    Thank you!

  7. Posted June 25, 2008 at 2:38 pm | Permalink

    Marco -

    So are you saying that rdcmndGotoSlide *does* work so long as you don’t have a question slide? I haven’t been able to get it to work no matter what, even for plain presentation content in captivate.

  8. Paul W
    Posted July 30, 2008 at 2:40 am | Permalink

    I am experimenting with embedded code swfs, but captivate 3 seems to keep the previous inserted swf of the same name, even if I delete and re-insert. I seem to have to keep renaming the swf to somthing new, and embed that. Is there a way around this?

  9. Posted July 30, 2008 at 9:37 am | Permalink

    This is another one of those bugs that just drives me up a wall. Almost as much as the fuzzy text with transparent captions bug.

    I don’t recall coming up with a workaround for it. In case you’re wondering, all versions of Adobe Connect (I haven’t tested it with the new version 7 yet) have this same problem. It’s really frustrating.

  10. Posted August 2, 2008 at 2:15 am | Permalink

    Clayton,

    Here we are months later and I want to apologize - you were correct! rdcmndGotoSlide does work. I tried it twice before and never could get it to work. I believe it is a Captivate 3 thing, but I may be wrong. But, in Captivate 3, it works, I know that! I just wrote a blog post about it as there are some quirks but it works great.

  11. Eric
    Posted August 26, 2008 at 7:41 pm | Permalink

    hello,
    I have Captivate 3 and the rdcmndGotoSlide works (do not have a quiz slide in my test Captivate swf.). But… I have tried (and failed) the rdcmndGotoFrame(myframenumber); with out success. Has any one got this to work?
    I am using Captivate 3.0 with code swfs (for some info on a slide),
    and the basic rdxxx variables for #slides, currentslide, etc.

    I did try Marks - “pause, gotoandresume = frame number, resume”

    I would like to be able to even hide the playbar (no good), and go to a specific frame and pause.

    I am using an actionscript 2.0 document, and an mx.controls.loader component to load the Captivate swf. I refer to the Captivate swf like this:

    myRoot_mc.myLoader_ldr.content.cpSkinLoader_mc.rdcmndPause = 1;
    myRoot_mc.myLoader_ldr.content.cpSkinLoader_mc.rdcmndGotoSlide = 0; myRoot_mc is equiv to “this” in my fla loader file (cleverly named CaptivateLoader.fla)
    Tips? and thank for the pause, gotoandresume, resume tip - it led me to the GotoSlide!

    eric

  12. Posted August 29, 2008 at 9:26 pm | Permalink

    There’s an error in my code snippet above. You actually need to take out the rdcmndResume command (the third of the three in the script above). Why I put that in there I don’t know…must have been tired.

    mark

Post a Comment

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

*
*

Subscribe without commenting