all groups > flash actionscript > february 2007 >
You're in the

flash actionscript

group:

smarter way to load levels


smarter way to load levels JoeyJon
2/28/2007 9:36:36 PM
flash actionscript:
Briefly, I have four buttons which open new sections on a website in levels.
Each .swf has a preloader on it. So each time I press a button it will open
that level with the preloader regardless of whether it has previously been
opened.
So I guess what I'm asking is whether I can put an 'if' statement on the
button code to get it to skip the preloader and go to frame 3 if that .swf has
previously been loaded.
My current code for one my buttons is very simple...

on (release) {
unloadMovieNum(1);
unloadMovieNum(3);
unloadMovieNum(4);
loadMovieNum("attungacontact.swf", 2);
}


Re: smarter way to load levels kglad
3/1/2007 12:11:56 AM
you can store a variable/value in your main (_level0 swf) that will indicate
whether a particular external swf has loaded before. in the external swf you
can access that _level0 variable and take the desired actions.
AddThis Social Bookmark Button