Groups | Blog | Home
all groups > flash actionscript > june 2004 >

flash actionscript : preloader won't show until swf is 75% loaded


waveturtle
6/19/2004 10:49:32 PM
I'm trying to make a simple preloader that displays an image that fades in as
the Flash movie loads. The problem is, the preloader doesn't display until the
movie is 75-80% loaded...I don't know why...

here is the code I'm using, any help would be appreciated.

stop();
myInterval = setInterval(preloader, 10);

function preloader() {
if(_root.getBytesLoaded() >= _root.getBytesTotal()) {
gotoAndStop(5);
clearInterval(myInterval);
}
preloader_mc._alpha =
Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100);
percent_txt.text =
Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100);
}
sneakyimp
6/19/2004 11:29:42 PM
what is the movie you are loading like? does everything in it exist on the
first frame? do you have a lot of items in your movie that you have exported
for actionscript in your library? if so, they are probably being 'exported in
the first frame'.

you may want to try putting your preloader in a separate file....that way the
preloader (which is really small) will load first in its entirety and then it
can display your progress bar and begin to load the other movie.
AddThis Social Bookmark Button