ADDING A PRELOADER Flash: Interactive Web Animation by Ken Kimura
Setting Up Your Projects
Any Flash movie that has sounds and or photos or are longer than a half minute should have a preloader. A preloader is a very compact and short animation that loops while the rest of the movie loads into the viewer’s computer. The first 2 frames of the timeline is where the preloader will reside. The third frame is where the content of your movie will begin and will be given a timeline “label.” You will write two scripts. One script will check to see if the movie has been completely loaded into the viewer’s computer. Once it has, it tells the movie to play the movie from our designated timeline “label.” Another script will make the first 2 frames play over and over as well as activating the check in the first script over and over.
Create a short movieclip symbol animation. This is the animation that will keep repeating while your movie is loading.
Select every frame of every layer of your first scene (shift click from one corner to the opposite corner).
Move all your frame layers so that your movie starts on frame 3
Insert a new layer for your preloader animation. Put your preloader MovieClip on the stage (name your layers).
Make sure your preloader is not on the stage during your movie. Do this by inserting a blank keyframe on frame 3 of your preloader layer.
Insert a new layer and name it “labels”
Label frame 3 of your labels layer as “start”
Put a keyframe on frame 3 of your labels layer.
In the Properties panel, look for the text “<Frame Label>.” Type in “start.” This will put a “label” in your timeline.
Create a new layer for your actions and name it “Actions” (it’s best practice to keep this layer the topmost layer)
Now create the preloader scripting on the first frame.
Select frame 1
Open your Actions Panel.
Click the Insert Script Item button (the large plus sign).
Select Statements > Conditions/Loops > If
In the parentheses type the following:
_framesloaded >= _totalframes
Type a return after the open bracket then-
Insert Global Functions > Timeline Control > gotoAndPlay
In the parentheses type “start”
Your script should like like the following:
if (_framesloaded >= _totalframes) {
gotoAndPlay("start");
}
Make your first two frames loop by putting the following action on the second frame (remember to put in a keyframe).