PDA

View Full Version : load/open another .swf with preloader


Jetbbal
02-25-2004, 03:14 PM
i recently read a tutorial on flashkit and the link is http://www.flashkit.com/tutorials/Actionscripting/Basic/Percenta-Chris_Be-870/index.php

i was just wondering what i would need to do to make the preloader load and open another .swf

another tutorial or some script would be greatly appreciated

thanks

BennyBlanco
02-25-2004, 11:28 PM
In your main swf make a button and assign this action to it:

on (release) {

loadMovieNum("yourown.swf", 1);

}

fill in your swf (with your preloader) and the level you want it to load in on
levels do not mean layers in the timeline!!!

in the swf that you have loaded make a button that closes it (an 'x' for instance) by assigning this action to it :


on (release) {

unloadMovieNum(1);

}


the (1) is the level (again,nothing to do with layers etc) wich contains the loaded swf (1 in this case corresponding to the top action)

nthpixel
02-26-2004, 07:50 AM
If you want to load the other .swf when the preloader is done, just use the script given in the flashkit.com tute and add the loadMoveNum() to it.

if (percent == 100){
loadMovieNum("myFile.swf", 1);
}else{
gotoAndPlay(1);
}

Jetbbal
02-26-2004, 08:29 AM
thanks for the help guys

Jetbbal
02-26-2004, 08:34 AM
where would i put this new code?

nthpixel
02-26-2004, 08:36 AM
According to the flashkit.com tute, it should go on the second frame in the preloader timeline.

Jetbbal
02-26-2004, 08:42 AM
so i just replace the code they had with the code you provided?

nthpixel
02-26-2004, 08:45 AM
that's correct

Jetbbal
02-26-2004, 08:54 AM
for some reason its not working, it just keeps on looping.

so i just put the original code on the second frame and put a

loadMovieNum("myMovie.swf", 1);

on the third frame and it seems to work

i can't really see the percentage bar go up cause i don't have a large enough file to test it on but i think its alright