Imported SWF Timeline control in Flash
How to control imported .swf timeline?
var introLoader:Loader = new Loader();
var introReq:URLRequest = new URLRequest("intro.swf");
introLoader.load(introReq);
introLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
function onCo开发者_开发知识库mplete(e:Event){
addChild(introLoader);
}
Use loader.content to access the loaded content.
//store it in an instance variable for conveniently
//accessing it from outside.
public var loadedmc:MovieClip;
function onComplete(e:Event)
{
addChild(introLoader);
if(introLoader.content is MovieClip)
loadedmc = introLoader.content as MovieClip;
else
{
trace("its not even a movie clip - no timeline for you");
return;
}
loadedmc.gotoAndPlay(4);
}
//Once loaded (once Event.COMPLETE is fired),
//you can always access it using:
MovieClip(introLoader.content).gotoAndStop(3);
精彩评论