Jump to content

can we use flash preloder for different file?


Recommended Posts

Hello guys, may i ask you how to use flash as preloader for another flash?

Hey dude :) now umm...right this depends what your trying to do!Are you making a flash website? If so make the pre loader one fla and swf and the main site another fla & swf
loadMovieNum ("nameofswf.swf", 1);

That code might work I dont know...only ever tried it once :S

Link to comment
Share on other sites

Yes you can do that. Funky junky was coorect, but if I were you I would just put the progress bar in with hte timeline. As for what you said smiles. This would be a good vode to use for a preloader.

totalbytes = getTotalBytes();loadedbytes = getLoadedBytes();

That would create a variable to use when you need to know or identify how many bites there are (loaded or total)To get the kilobytes you could use this code.

totalkbytes = Math.ceil(totalbytes/1000);loadedkbytes = Math.ceil(loadedbytes/1000);

And to get the percent loaded to show you could use this code after you make a dynamic text box with the instance name percent

percent.text = Math.ceil(totalbytes/loadedbytes*100)+"%";

Then to make the movie load when all the bytes are loaded you could use this code.

if (loadedbytes == totalbytes) {_root.gotoAndPlay(frame number movie start)};

I'm doing this for your benefit too theotherside, since I don't know if you're aware of how to make a simple preloader.So here is what I usually do.( I would do all of this on the first frame and make the movie start on the second framn.Make a dynamic text feild with the instance name of percent, which is 100 width. Make two more with the instance names of loadedk and totalk, now copy and paste the following code into your actions layer of the timeline.

stop();totalbytes = getTotalBytes();loadedbytes = getLoadedBytes();totalkbytes = Math.ceil(totalbytes/1000);loadedkbytes = Math.ceil(loadedbytes/1000);percent.text = Math.ceil(totalbytes/loadedbytes*100)+"%";totalk.text = totalkbytes+"kb";loadedk.text = loadedkbytes+"kb";if (loadedbytes == totalbytes) {_root.gotoAndPlay(2)};

Link to comment
Share on other sites

^ Nice :) Actually thats really really helpful :) I was using a preloader my friend made because i could get my head around how to make a working one!Thats really helpful Thanks Kasdraven!A 5 Star post there! *****

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...