views:

1769

answers:

1

I'd like to be able to play/pause dynamically loaded external SWF movies using ActionScript 3.0. Any help is appreciated. Thank you.

+1  A: 

The loaded SWF's are accessible through the Loader's content property. You can cast the content property to your loaded SWF's Document Class to access methods of your SWF directly. Of course you can simply use the play(); and stop(); ... if you just want to play time-line animations :

var loader:Loader = new Loader("anim.swf");
addChild(loader);

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);

function completeHandler(e:Event):void
{
    var movie:MovieClip = e.target.content;
    movie.play();
}
Theo.T