Welcome Guest Search | Active Topics | Members

Preloader Tutorial [Beginner - Intermediate] Options
jjiskooler
Posted: Tuesday, July 06, 2004 11:31:46 AM
Rank: Newbie

Joined: 7/6/2004
Posts: 5
Everyone is always trying to learn how to make a preloader. You can download them, but it's easiest when you can just make your own!

Simple Preloader

Start with 3 frames. Open up the actions for the 1st frame. Make a new variable called "loaded" and in it put "getBytesLoaded()". Make another variable called "total" and in it put "getByteTotal()". Now create an if action and in that put "loaded==total". This will check to see if the loaded bytes and total bytes are equal. Below the if action put "gotoAndStop(3);".

Your actions should look something like this:

loaded = getBytesLoaded();
total = getBytesTotal();
if (loaded==total) {
gotoAndStop(3);
}

In the 2nd frame actions put "gotoAndPlay(1);". You can put your play button on the 3rd frame!


Advanced preloader (do the above)

Make a rectangle which will be the loading bar. Select it and goto Insert/Convert to Symbol or for Flash MX 2004 Modify/Convert to Symbol or just press F8. Convert it into a movieclip (keep border outside of movieclip). Now select the new movieclip and goto it's actions. Start with an onClipEvent action and in it put "load". Create a variable called "sw" and in that put "_width". Now make another onClipEvent action and in it put "enterFrame". Under that make a variable called "_width" and in it put "sw*_root.loaded/_root.total". Goto the main timeline and make a dynamic text field called "p". Go back to the load bar actions and under the variable called "_width" make another variable called "_root.p" and in it put "int(100*_root.loaded/_root.total)+"%"".

Your actions should look something like this:

onClipEvent (load) {
sw = _width;
}
onClipEvent (enterFrame) {
_width = sw*_root.loaded/_root.total;
_root.p = int(100*_root.loaded/_root.total);
}


If you have any questions regarding this tutorial or any other question involving Flash you can email me at sk8r831@yahoo.com and I will get back to you as soon as possible!
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.