PDA

View Full Version : preloading a .swf



sAjber
September 19th, 2001, 01:52 PM
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...

kirupa
September 19th, 2001, 05:19 PM
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 :)

suprabeener
September 19th, 2001, 06:08 PM
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

sAjber
September 20th, 2001, 02:22 AM
ok tnx suprabeener ! ill try it

sAjber
September 20th, 2001, 03:48 AM
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... :(

u got any other suggestions ?

sAjber
September 20th, 2001, 03:56 AM
OMG!! I JUST FOUND THIS ON THE WEB!!

www.flashkit.com/movies/S...reloaders/ (http://www.flashkit.com/movies/Scripting/Preloaders/)

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

YEEEHAAAAAAAAAAAAAAWWWWWWWWWWWWW

upuaut8
September 21st, 2001, 01:58 AM
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. :)

sAjber
September 21st, 2001, 03:07 AM
np ^^

sidky76
September 21st, 2001, 03:40 AM
ey sAjber, went there but there were too many of them.
u still remember the exact title of the one that suited ur need?

sAjber
September 21st, 2001, 09:55 AM
ya its was named:

Preloader for external .swf files!

sidky76
September 21st, 2001, 09:34 PM
thanks, will check it out.

dodo
September 22nd, 2001, 06:09 AM
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