Preloading a .swf

is there anyway to preload a .swf file ?
example: i got a button and when i press it i want some script on it telling the .swf to be preloaded before it actually comes up… i already know about

if (_framesloaded>=_totalframes) {
&nbsp &nbsp &nbsp &nbsp gotoAndPlay (2);
} else {
&nbsp &nbsp &nbsp &nbsp gotoAndPlay (1);
}

but that script is only when i got the .swf in and its on frame1…

Hey sajber,
This was a very popular question a few weeks ago on this thread. I don’t think we were able to find a way to do this. Try posting this in the ActionScript forum, I bet Thoriphes, supra, upuaut, eyezberg, dan, vts, or some of our other master flashers might know what to do :slight_smile:

you can leave the first frame of the swf you’re loading blank with a stop action in it.

then in your main movie (say you load it into level 3) loop these actions:

progress = _level3.getBytesLoaded()/_level3getBytesTotal()*100;

if(progress == 100){
_level3.gotoAndPlay(2);
}

you can also use that progress variable to make a nice loading bar.

good luck

ok tnx suprabeener ! ill try it

hmm cant say it worked…**** =(
but on the other hand i gotta have an action before that 1 u wrote… an action that loads the .swf into the right layer !!
else it aint nothing in the layer it is trying to load…

i know there is ways to preload the .swf before it pops up…
but i cant figure it out mysef… :frowning:

u got any other suggestions ?

OMG!! I JUST FOUND THIS ON THE WEB!!

www.flashkit.com/movies/S…reloaders/

here is like all the preloader types in the world !!!
and i found 1 that is exactly what im after !!! ^^

YEEEHAAAAAAAAAAAAAAWWWWWWWWWWWWW

Good for you… and thank you very much for posting the link… most people would have found that and never responded back to this thread. :slight_smile:

np ^^

ey sAjber, went there but there were too many of them.
u still remember the exact title of the one that suited ur need?

ya its was named:

Preloader for external .swf files!

thanks, will check it out.

youll have to make a nwe movie/swf…then insert a preloader in this movie…then u give the butten the action that u want…a _root. action should be best in this case if you want to load this swf from another swf