Flash Script – Loader Intro

By Georgina Laidlaw
We teamed up with SiteGround
To bring you the latest from the web and tried-and-true hosting, recommended for designers and developers. SitePoint Readers Get Up To 65% OFF Now


This tutorial shows you how to create a great loader animation. Download the sample files here.

1. Create some short, static text, and name it "Loading". Convert this to a symbol, and call it "loader".

2. Use loader symbol to create a rotating movieclip. Give this movieclip an instance name of "ball".

3. Create three key frames in the scene. In the first, insert the action:

//initialize variables. 
i = 0;
a = 10;

4. In the second key frame, insert the action:

if (Number(i)<10) 
{
//Create duplicate movie clip
duplicateMovieClip("ball", "ball" add i, i);
//decrease the alpha of the dupliacte movieclip
setProperty("ball" add i, _alpha, 50-(i*(50/a)));
i = Number(i)+1;
}

5. In the third key frame, insert the action:

gotoAndPlay(2);

Now, play the movie!

We teamed up with SiteGround
To bring you the latest from the web and tried-and-true hosting, recommended for designers and developers. SitePoint Readers Get Up To 65% OFF Now
Get the latest in Front-end, once a week, for free.