以下是代码:您可以在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);
}
}