First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: Anthony Frizalone | Website: http://joefrizalone.akassp.com/

First, open flash, and make a New file. Now, click the rectangle tool (or press R on your keyboard), and draw a textbox.

Next, just click the middle, or the fill of the new rectangle, and right click, and go down to Convert To Symbol.

Then, make sure to assign the Instance Name of the box:

Now, read this carefully, unless you want your loader bar to load from the middle to the sides!

Double Click on the bar movie clip. In the middle of the clip, there should be a small cross, surrounded by a cirlce. Move the bar so that that specific cross is on top of the left side of the bar. In doing this, the loader bar will load from the left to right, instead of from the middle out. Make sure to do that! After you have done that, double click on the bar again, to get back to the Scene.

This next part is optional! Click the text tool (or press T on your keyboard). Adjust the font to what you want it to be, and size, and type in Loading...
Remember, this part is completely optional!

This next part is manditory for a perfected, working preloader bar!

On your keyboard (if you have a Windows) press F6. If you don't have a Windows, then right click on Frame 2 on your timeline, and click Insert Keyframe.

On this Frame, on the Timeline at the top, right click again, and go down to Actions, and click.

Add this action to the Frame:


Once you have done that, go back to the first frame, with the preloader bar and add the following actionscript:

loadpercent = _root.getBytesLoaded() / _root.getBytesTotal * 100;
if(loadpercent != 100){
setProperty(bar, _xscale, loadpercent);

Now, for the very last part!!

Go back to your timeline, and right click. This time, go down to Insert Blank KeyFrame. On this Frame, add anything you want! Text, a picture, a movie, whatever you please!

Now, let's break that actionscript!

The First part:


That just stops on that Frame.

The part after that:

loadpercent = _root.getBytesLoaded() / _root.getBytesTotal * 100;

This part assigns a variable, with the name loadpercent. It gets the Bytes of the File that have already been loaded, divides it by the Total Bytes, and then multiplys it by 100, so that the division isn't a decmial.

The if statement..:

if(loadpercent != 100){
setProperty(bar, _xscale, loadpercent);

First, the if statement tests to see that the variable loadpercent is at 100, which would mean it is fully loaded. It says if the variable doesn't equal 100, then use the setProperty(); function:

These are the parameters of the setProperty(); funtion: setProperty(target, property, value);

First, target. This tells the function what clip to target, and assign the follow property to.

Next, property. This is the property of the specific clip to set. In this case, _xscale.

And Last, value. This is the value of the property being assigned. In this case, it was loadpercent.

Now, if the if statement returns true, then the setProperty(); function is used to show how much of the movie is loaded through a bar movieclip. If the statement returns false, and the movie is


This about sums it up! Basically, using actionscript, we test to see if the movie is loaded, and change the size of the bar if it isn't, and go to the nextframe if it is! I hope this tutorial helped you a great deal! Hopefully, in the future, I will write more tutorials! But I haven't much time to do so, what with sports and school...P.S.:
I'm only 13 years old!! Lol..anyway, if you have any questions, feel free to email me at antsam@akassp.com, or, reach me on AIM (Aol Instant Messenger) at: MasnaX ! I'll be glad to help in anyway that I can! Thank you for reading!! Hope I've helped you!

» Level Basic

Added: 2004-04-04
Rating: 4 Votes: 33
(10 being the highest)
» Author
I know PHP, HTML, some Flash, and other programming languages..I design websites..and other things. If you need a website designed for you, Instant Messege me at MasnaX and I will gladly help, but I will only design for pay.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.