开发者

Imported SWF Timeline control in Flash

开发者 https://www.devze.com 2022-12-22 11:11 出处:网络
How to control imported .swf timeline? var introLoader:Loader = new Loader(); var introReq:URLRequest = new URLRequest(\"intro.swf\");

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消