PDA

View Full Version : preloader problem


jedi23
06-30-2006, 08:52 AM
i have a preloader problem...

this is my code:

stop();
myInterval = setInterval (preloader, 10);
function preloader () {
if (getBytesLoaded()>=getBytesTotal()) {
play();
clearInterval(myInterval);
}
bar_mc._xscale = (getBytesLoaded()/getBytesTotal())*100;
myLoading_txt = Math.round(getBytesLoaded()/getBytesTotal()*100)+"% of Bytes Loaded";
}

...it's written on the first frame of the movie.

i have a movie clip with this code at _level0 and another movie clip has this at _level1.

I have a button at _level0 with this code:

on(release){
unloadMovie(1);
loadMovieNum("myMovie.swf",1);
}

....It's written in a button.

What i want to do is when i click on the button, it unloads whatever movie is at level 1 then load a new movie on to the same level which is level1.

Here's the problem, if i click the button before the preloder is done loading the whole movie at level1, it screws up my entire movie already. Why? and how can i remedy this?

HELP PLEASE...:confused:

stiakooo
06-30-2006, 10:15 AM
Hello!
Use MovieClipLoader class instead of loadMovieNum and setInterval for the preloader.
It's much better.