I've developed a project where I need to show the user that the file itself is loading. The project has two scenes: In the first scene I created a preloader
with the code:
stop();
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, carregando);
this.loaderInfo.addEventListener(Event.COMPLETE, carregou);
function carregando(e:ProgressEvent):void {
preloader_txt.text = "CARREGANDO: "+int((this.stage.loaderInfo.bytesLoaded/this.stage.loaderInfo.bytesTotal)*100)+"%";
}
function carregou(e:Event):void {
play();
}
In the second scene is the entire contents of my file SWF
.
I configured all my classes to be imported into Frame 2 of my application, so frame 1 would only be responsible for loading the file.
When I test the local machine, everything happens successfully, I see my file being loaded and the percentage is displayed on the screen.
But when I upload to my server on the internet and load it, the preloader appears only at 100%, ie when the flash is fully loaded.
I've tried different browsers, and yet the problem occurs.