Flash tutorials
Home 3D (2) Actionscripting (66) Animation (108) Audio (4) Drawing (7) Full flash sites (4) Getting Started (15) Navigation (25) Special Effects (61) Text Effects (38)

Simple Professional Flash Preloader

8.7.2010, 22:47    Total views: 18132

Read this action script lesson and learn how to create professional flash preloader. You can use this preloader for any web site. Let's start!







Example:



Step 1

Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the width of your document to 400 pixels and the height to 300 pixels. Select #161616 color as background color. Set your Flash movie's frame rate to 34 and click ok.



Step 2


Call the current layer preloader. Double-click on its default name (Layer 1) to change it. Press Enter once you have typed in the new name!

Step 3

Select the Text Tool (A) and go to the Properties Panel (Ctrl+F3) below the stage. Then, choose the following options:

1. Select a Static Text field,
2. Select a Zurich Blk BT as font type.
3. Choose 64 as font size.
4. Select white as font color,
5. As the rendering option, select Use Anti-alias for readability.



Step 4

Type somewhere on the flash stage loading. See the picture below.



Step 5

While the text (loading) is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.



Step 6

Double-click on the movie clip on stage with the Selection tool (V). You should now be inside the movie clip.

Step 7

Call the current layer text. Double-click on its default name (Layer 1) to change it. Press Enter once you have typed in the new name!

Step 8

Click now on frame 100 of layer text and hit F5 key.

Step 9

Create a new layer above the layer text and name it percent.

Step 10

Select the percent layer, takle the Text Tool (A) and go to the Properties Panel again (Ctrl+F3) below the stage. Then, select the following options:

a) Select a Dynamic Text field .
b) Select a Times New Roman CE as font type.
c) Choose 26 as font size and bold it.
d) Select #C00F02 as color.
e) As the rendering option, select Anti - alias for readability.
f) for var type percent12



Then, draw a rectangle shape on the bottom left side of loading text. After that, type on that rectangle 99%. See the picture below!



Step 11

Go back on the main scene (Scene 1).

Step 12

Select the Selection Tool (V) and click once on the preloader to select it. Then, go to the AS panel (F9) and enter this code inside the actions panel:

onClipEvent (load) {
total = _root.getBytesTotal();
} onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int(loaded/total*100);
percent12 = ""+percent+"%";
gotoAndStop(percent);
if (loaded == total) {
_root.gotoAndPlay(2);
}
}

Step 13

Select now the first frame and go again to the AS panel (F9). Then, enter this code inside the actions panel:

stop();

We're done now with the preloader. To see how it works, create a new layer above the layer preloader and name it movie. After that, click on frame 2 of layer movie and hit F6 key. While you're still on frame 2, import some movie or image into a flash stage. That's it!

Enjoy!

Download source file (.fla)

Have questions about this tutorial?
Visit our friendly Community Forums!
Digg it! Add this tutorial to del.icio.us! Furl it! Add this tutorial to reddit! Spurl it! Add this tutorial to technorati!

Top tutorials

1. Advanced full flash site - Part 1
Total views: 310287

2. High-tech city animation
Total views: 272904

3. Water effect
Total views: 237059

4. Photo slide show
Total views: 220388

5. Special Picture Effect
Total views: 190723



Related links