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
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.
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"); } }
Don't see what you're looking for? Try a search.
|