[問題] Preloader可以載入圖片 但swf失敗
小弟手邊有一個剛寫好的swf
想在他前面掛上preloader
public function startLoading():void {
this.addChild(_loadingBar);
this.addChild(_percentText);
_gameLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadingHandler);
_gameLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadingFinish);
_gameLoader.load(new URLRequest("XXX.swf"));
}
private function loadingHandler(event:ProgressEvent):void {
var percent:Number = event.bytesLoaded / event.bytesTotal;
_loadingBar.scaleX = BAR_MAX_LENGTH * percent;
_percentText.text = Math.round(percent*100)+"%";
}
private function loadingFinish(event:Event):void {
_gameLoader.contentLoaderInfo..removeEventListener(ProgressEvent.PROGRESS, loadingHandler);
_gameLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, loadingFinish);
this.removeChild(_loadingBar);
this.removeChild(_percentText);
addChild(_gameLoader);
}
如果換上jpg的圖片是可以動的
可是換上我的swf就不能跑了
那個swf獨立跑是正常的
哪裡出了問題呢
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.42.226.177
→
04/07 23:02, , 1F
04/07 23:02, 1F
→
04/07 23:10, , 2F
04/07 23:10, 2F
→
04/08 01:22, , 3F
04/08 01:22, 3F
Flash 近期熱門文章
PTT數位生活區 即時熱門文章