Controlling Captivate SWFs from Flash…this time using the Loader Component

 

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!

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

 

3 Comments

  1. Clayton
    Posted January 31, 2008 at 5:40 pm | Permalink

    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.

  2. Posted August 9, 2008 at 6:29 am | Permalink

    thanks!
    found your example via google. it helped me!

  3. Christian
    Posted November 13, 2008 at 10:12 am | Permalink

    Thanks alot!

    This saved my day.!

Post a Comment

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

*
*

Subscribe without commenting