我正在加载一个 swf,其中包含帧上的声音,并且声音在加载时开始播放,然后将其添加到舞台上......用于加载和添加 swf 的代码如下......
private function loadSWF(path:String):void
{
var _req:URLRequest = new URLRequest();
_req.url = path;
_swfLoader = new URLLoader();
setupListeners(_swfLoader.contentLoaderInfo);
_swfLoader.load(_req);
}
private function setupListeners(dispatcher:IEventDispatcher):void
{
dispatcher.addEventListener(Event.COMPLETE, addSWF);
}
private function addSWF(event:Event):void
{
event.target.removeEventListener(Event.COMPLETE, addSWF);
event.target.removeEventListener(ProgressEvent.PROGRESS, preloadSWF);
_swfLoader.addEventListener(Event.ADDED_TO_STAGE, onLoadComp);
_swfContent = event.currentTarget.content;
stage.addEventListener("close", unloadSWF);
stage.addChild(_swfLoader);
}
请帮忙...