Toxiclab.org

Yellow Black Professional Preloader

13.7.2010, 10:27
Submited in: Flash | Total Views: 14347

In this action script tutorial we're going to create a simple yellow and black preloader. You can use this preloader for any web site. Let's start!



Step 1

Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the width of your document to 300 pixels and the height to 200 pixels. Select #FFA800 color as background color. Set your Flash movie's frame rate to 36 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 Trebuchet MS as font type.
3. Choose 36 as font size.
4. Select black 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 Trebuchet MS as font type.
c) Choose 27 as font size and bold it.
d) Select white as color.
e) As the rendering option, select Anti - alias for readability.
f) for var type percent1



Step 11

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



Step 12

Go back on the main scene (Scene 1).

Step 13

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);
percent1 = ""+percent+"%";
gotoAndStop(percent);
if (loaded == total) {
_root.gotoAndPlay(2);
}
}

Step 14

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!

Please Enjoy!

Download example

Are you a website owner?
Click here to register and submit your tutorials!

Browse by category


Most popular tutorials