Flash中导入的SWF时间轴控件

时间:2010-03-08 11:38:41

标签: flash actionscript-3 flash-cs4

如何控制导入的.swf时间线?

   var introLoader:Loader = new Loader();
    var introReq:URLRequest = new URLRequest("intro.swf");
    introLoader.load(introReq);

    introLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);

function onComplete(e:Event){
    addChild(introLoader);
 }

1 个答案:

答案 0 :(得分:1)

使用loader.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);