Flash preloader starts at only 90%

I am working on a game in Flash CS5 / AS3 and I am trying to get my preloader to work. At the moment, when I load a SWF file using "simulate loading", the file is loading, but my preloader will not be displayed. The preloader really shows when the load is about 90%.

I unchecked "export to first frame" since the Internet told me, but there are so many different tutorials for almost every version of Flash / AS that I'm pretty confused; not sure how to fix it.

My preloader code is as follows:

stop();

this.addEventListener(Event.ENTER_FRAME, loading);

function loading(e:Event):void{

var total:Number = this.stage.loaderInfo.bytesTotal;
var loaded:Number = this.stage.loaderInfo.bytesLoaded;

percent_txt.text = Math.floor((loaded/total)*100)+ "%";  

if (total == loaded){
play();
this.removeEventListener(Event.ENTER_FRAME, loading);
}

}

, - . , - . - , ( ), , , .

!

+3
2

- 1 , THAT- - 1. "" 2 actionscript. 90%. , 2 gotoAndPlay (2).

(, , ) SWF-, swf. preloader swf , swf. swf Loader , BulkLoader, .

, .

+2

, "", " " . , , . , 30 , . ( ..). , , , " 1" .

this.stage.loaderInfo root.loaderInfo.

stop();

var total:uint = root.loaderInfo.bytesTotal;
var loaded:uint = 0;

addEventListener(Event.ENTER_FRAME, loading);
function loading(e:Event):void
{
    loaded = root.loaderInfo.bytesLoaded;
    percent_txt.text = Math.floor((loaded/total)*100)+ "%";  

    if(total >= loaded)
    {
        removeEventListener(Event.ENTER_FRAME, loading);
        play();
    }
}
0

All Articles