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.

 

7 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.!

  4. Dave
    Posted February 16, 2009 at 10:53 pm | Permalink

    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

  5. Posted February 16, 2009 at 10:57 pm | Permalink

    Dave.

    Are you using Captivate 4 by any chance, and AS3-based swf’s?

    mark

  6. Dave
    Posted February 16, 2009 at 11:31 pm | Permalink

    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

  7. Posted October 5, 2009 at 5:42 pm | Permalink

    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.

Post a Comment

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

*
*

Subscribe without commenting