I’ve had a few folks ask me if it is possible to load Captivate-generated SWFs into a Flash SWF using a loader component.
The answer is yes, and it’s what I typically do.
To take it one step further, you can use all of the Captivate rdcmnd variables referenced in my previous blog entry to control it, just as if it were loaded into the Flash SWF via loadMovie().
Here is a code example:
var myRoot_mc:MovieClip = this; //reference to root timeline (this one) (I use this instead of _root as it’s bad practice to reference _root)
//load the cp swf into the loader component
myLoader_ldr.contentPath = “captivate_1.swf”;
//stop and play buttons to control cp swf from root timeline
this.pause_btn.onRelease = function() {
myLoader_ldr.content.rdcmndPause = 1;
this._alpha=25;
this.enabled = false;
}
this.resume_btn.onRelease = function() {
myLoader_ldr.content.rdcmndResume = 1;
myRoot_mc.pause_btn._alpha=100;
myRoot_mc.pause_btn.enabled = true;
}
So as you can see from the above example, you can use the same variables as before, just by accessing them via the “content” reference that the loader component uses for any swf that is loaded into it. Hope this helps!
7 Comments
I begain to solve this by capturing and analyzing the DoFS calls from the published swf (using alert to display the call data) – easier, would be reading the acutal variable data from the Captivate swf. If you encounter any good resources for this (a variable list similar to the Captivate swf function list) please post here or contact me.
Thank you.
thanks!
found your example via google. it helped me!
Thanks alot!
This saved my day.!
Hi
We have an issue where imported swf files within captivate (Codebaby), play all the audio in one go at the very start – during pre-loader. We have played with rdcmndMute but no success so far. Any sugguestion would be most welcome.
Cheers
Dave.
Are you using Captivate 4 by any chance, and AS3-based swf’s?
mark
Hi Mark
Captivate 3 – and we think AS2. The output is from Codebaby, but we have the same issue with all audio swfs.
Cheers Dave
Hi
Thank you for all the info about flash and captivate.
I found that if you want to disable the mouse clicklistner – it’s possible like this:
movie.m_clickHandler_mc.addListeners();
movie.m_clickHandler_mc.removeListeners();
If you have loaded the captivate swf into another movieclip you it could look something like this: holder.movie.m_clickHandler_mc.addListeners();
holder being the instance name of a movieclip. I have not investigate how this is done i as3 – so if anyone knows – please post your answer.