Holiday Flash eCard Tutorial – Simple Percent Preloader
Tis the season for Flash eCards. If your flash card is a large file size, you will need to incorporate a preloader into your card to give your audience the full experience of your animations and/or music. Follow the steps below to create a simple, yet elegant and effective preloader that counts numerically in percentage from zero to 100%. Let’s assume that you already have created the flash card, but need to add a preloader to the beginning of it.
Note: This tutorial is demonstrated in Adobe Flash CS4. Screen views may differ from other versions.
- To begin, open your flash (.fla) file.
- Create a new scene by opening the Scene panel Window > Other Panels > Scene (Shift+F2).
- Click on the "Add Scene" icon located in the bottom left corner of the Scene panel. This will be in addition to the existing Scene called "Card".

- Once created, double click on the scene and type in "Preloader". When done, click anywhere on the panel and the change will be made.

- Now, you will need to put the preloader in front of the actual card. With the Scene panel still open, click and drag the Preloader scene you just created and move it directly above the main card then release your mouse.

- At this point, either close the Scene panel or move it aside. The current work area should already be set to the preloader.
- On the first layer, decorate the preload screen with your own custom background graphic, color, etc. Open the Library and drag all images you want to be on your preload screen. In this example, I also included my company’s logo.

- Insert a new layer on the time line and name it "Loading". Using the tools palette, choose the type tool and type in the word "Loading…" into the new layer you just created.

- Create a new layer and name it "Percent". With the text tool still open, type in "100%" and style it any way you like. Then, remove the text and expand the width and height of the box so the text will fit in it.

- Under "Properties" with the percent object selected, choose "Dynamic Text" from the drop-down list.
- Under Instance name, type in "loadingPercent" (without quotes of course).
- On the scene time line, create one more layer and name it "Actions".
- On the first keyframe (click F6), right click to get the context menu and then choose "Actions".
- For actions, copy and paste the following into the panel and then close it and go back to the time line.
percent = Math.floor(getBytesLoaded()/getBytesTotal()*100);
loadingPercent.text = percent + " %"; - On the second keyframe of the "Actions" layer, right click the keyframe, choose "Actions" from the context menu, then copy/paste the code below into the panel. When done, close the panel.
if (percent ==100){
gotoAndPlay("Card",1);
}else{
gotoAndPlay(1);
} - Your time line should look something like this:
accupril generic alt=”Layers in the Time line.” title=”Preloader 6″ width=”308″ height=”150″ class=”alignnone size-full wp-image-331″ /> - At this point, you should be ready to test your movie. Control > Test Movie (Ctrl+Enter)






