var movieSwf:MovieClip=new MovieClip();
var movieCopy:MovieClip=new MovieClip();
private function initLoader():void
{
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler);
request = new URLRequest(path);
loader.load(request);
movieCopy.addChild(loader);
}
private function completeHandler(e:Event):void
{
movieSwf=e.target.content;
movieSwf.gotoAndStop(1);
this.addChild(movieCopy);
}
var movieCopy:MovieClip=new MovieClip();
private function initLoader():void
{
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler);
request = new URLRequest(path);
loader.load(request);
movieCopy.addChild(loader);
}
private function completeHandler(e:Event):void
{
movieSwf=e.target.content;
movieSwf.gotoAndStop(1);
this.addChild(movieCopy);
}
本文介绍了一个使用ActionScript 3.0实现的Flash加载与播放器的简单实例。该实例通过创建MovieClip对象来加载外部SWF文件,并将其添加到舞台上进行播放。文中详细展示了如何通过监听Loader对象的COMPLETE事件来初始化加载的Flash内容。
396

被折叠的 条评论
为什么被折叠?



