actionscript-3 – Problem with web preloader

Question:

I developed a project where I need to show the user that the file itself is being loaded. 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 all the contents of my SWF file.

I configured so that all my classes were imported in Frame 2 of my application, so frame 1 would be responsible only for loading the file.

When I do the test on the local machine, everything goes successfully, I see my file loading and the percentage is displayed on the screen.

But when I go up to my server on the internet and load it, the preloader only appears at 100%, that is, when the flash is all loaded.

Tested in different browsers and still the problem occurs.

Answer:

I managed to solve the problem! The problem was in the compression mode that the server performed on the SWF, going to GZIP mode, when in fact it should use DEFLATE.

I got the answer from SOEN at this link: https://stackoverflow.com/questions/22078076/preloader-does-not-work-online

Scroll to Top
AllEscort