this.stage.loaderInfo.bytesLoaded返回0

时间:2013-05-16 10:11:51

标签: actionscript-3 flash-cs3

以下是代码:您可以在http://humordestination.com/game/

看到它
stop();
this.addEventListener(Event.ENTER_FRAME, loadingPL);
function loadingPL(e:Event):void{
    var totalData:Number = this.stage.loaderInfo.bytesTotal;
    var loadedData:Number = this.stage.loaderInfo.bytesLoaded;
    loaderGreen.width = loadedData/totalData * progressText.width;
    progressText.text=String(Math.floor(loadedData/totalData*100)) + "%";
    TotalData.text=totalData.toString();
    LoadedYet.text=loadedData.toString();
    if (loadedData == totalData) {
            gotoAndStop(2);
            this.removeEventListener(Event.ENTER_FRAME, loadingPL);
    }
}

0 个答案:

没有答案