all groups > flash actionscript > december 2004 >
You're in the

flash actionscript

group:

Preloader for another Level



Preloader for another Level meeesta
12/17/2004 8:49:15 PM
flash actionscript: Hello. Funny, I've just seen a message titled 'Not another Preloader Question'
and here I am. Anyhoo, I've done on (enterFrame) type doing bars before. But
I've got a base movie, into which I first load the loading bar movie (into
level2) and when that's loaded in it starts loading the main movie into
level1. I've got this bit of code on the loading bar clip in level 2... but it
doesn't seem to work... onClipEvent (enterFrame) { percent =
int((_level1._framesloaded/_level1._totalFrames)*100); loaded = percent+'%';
if (percent == 100){gotoAndStop('ClearMe')}; if
((int(_totalframes*(percent/100)))< _currentframe){play();} else{stop();} }
Any pointers or tips would be greatly appreciated. Many thanks, Meeesta
Re: Preloader for another Level Rothrock
12/17/2004 9:02:42 PM
What happens if you put a trace(_level1._framesloaded);? I seem to recall that
you can't address a level until it is completely loaded, but I'm not sure. But
personally I never use levels because of stuff like this.
Re: Preloader for another Level kglad
12/19/2004 2:10:04 AM
you have several logical errors in your code. in addition, there is a
syntactical error in the following line:

if ((int(_totalframes*(percent/100)))< _currentframe)

it's not possbile to be certain the code below is what you want, but most
likely it is:

onClipEvent (enterFrame) {
loaded = Math.round(100*_level1._framesloaded/_level1._totalFrames);
percent = loaded+"%";
if (loaded<100) {
play(); // most likely this is unneeded, too
} else {
gotoAndStop("ClearMe");
}
}

AddThis Social Bookmark Button