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?
– Felipe Avelar
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.
– bio
The
loaderInfo
is already in thestage
?– Felipe Avelar
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.
– bio
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.– Felipe Avelar
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.
– bio
Because what seems to be happening is that he is carrying first the
SWF
and theMovieClip
only rings when it’s loaded.– Felipe Avelar
Are you using Flash Professional? If yes, you unchecked the option to export everything in the first frame?
– Felipe Avelar
@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!
– bio