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:
- 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.
- 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;
} - 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.
8 Comments
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
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
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;
}
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)
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.
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)
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
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)
One Trackback
[...] How-to: Non-Linear Navigation in Captivate Using rdcmndGotoSlide [...]