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);
}
}
, - . , - . - , ( ), , , .
!