Problem with preloader on the web

Asked

Viewed 116 times

3

I have 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 file SWF.

I set up so that all my classes were imported into Frame 2 of my application, so frame 1 would only be responsible for uploading the file.

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

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

I tested on different browsers and still the problem occurs.

  • Gets stuck at zero and pops up 100% at once?

  • No! The preloader doesn’t even appear when the flash is called... It only appears in the 100%. It’s like it’s useless and it doesn’t work, it just blinks "100%" and starts to appear SWF content.

  • The loaderInfois already in the stage?

  • I didn’t quite understand your question but I believe so. It is imported in frame 1 and as I said, in the local machine the same works correctly.

  • It has how to put the code of the first class that it executes (main)? Maybe it only matters in Stage after the swf is loaded.

  • In fact it does not have a main class, although I have already tested incorporating one with the same code that I posted above in the question. The same thing happened and the mistake still continues.

  • Because what seems to be happening is that he is carrying first the SWFand the MovieClip only rings when it’s loaded.

  • Are you using Flash Professional? If yes, you unchecked the option to export everything in the first frame?

  • @Felipeavelar, I advise you to read the question again, some of your questions are clear on the question. Anyway, we’re not getting anywhere. I don’t own any Movieclip on Stage, so which Movieclip is playing?... The title of the issue clearly showed that I was using the Flash, but you edited it... Finally, in the third paragraph of the question I quoted that I am exporting everything in the second frame of the application. Thank you again for your interest in helping me! I look forward to possible solutions!

Show 4 more comments

1 answer

0


Browser other questions tagged

You are not signed in. Login or sign up in order to post.