PDA

View Full Version : load a level, wait for that to play, load another level on top


StephBeez
09-25-2001, 10:37 PM
Okay, I had this "brilliant" idea that I could reuse the same "intro" swf over and over to play before the "content" swf loads. I need to be able to load the intro and have it wait to see that that's done, then load the content. I can't put a bunch of script in the content swf because all the content swfs can go between each other in order to bypass the into if you navigate within the content swfs.
Here's the code I've been trying....
on (release) {
loadMovieNum ("intro", 1);
if (_level1._totalframes == _level1._framesloaded) {
loadMovieNum ("content2.swf", 2);
gotoAndStop ("Start"); //this has the mc go back to it's "up" state
} else {
gotoAndPlay ("ButtonLabel"); //this probably isn't right, but it's the starting point of the button that activates the action. I thought it would keep going back and checking.... shyeah
}
}
I also tried getBytes with no luck

retrocool
10-01-2001, 12:32 PM
As far as I can remember, my preloader script (which plays a filling Guinness glass while the main movie loads) does exactly what you want. It's open source so download it, rip it's guts out and use as you will....

It's at http://www.premonition.co.uk/geoff/

Let me know how you get on...

retrocool

retrocool
10-01-2001, 02:32 PM
Just looked at it, what it actually does is this:
Main content movie swf loads.
It calls a "loading..." movieclip swf, with loadMovieNum. This plays graphics.
It loops, checking how many of it's frames have loaded.
When sufficient is loaded of the main movie, it starts to play.
The "loading..." movieclip unloads itself when it 'sees' the main movie playing.

The advantage is that you only need to load the 'loading...' graphic once, and then can use it whenever you need to preload part of a streaming movie. Then it loads from cache. Handy if you have a number of large MCs on your site, like I've got at http://www.premonition.co.uk and you want to optimise users bandwidth usage.

retrocool