How to Design a Simple Preloader by ActionScript
2009-08-08 21:04:25
The following is an example of a simple preloader. While you access the page, a "Loading..." message appears until the flash movie has finished loading.
Steps: (take reference of the preload.sqf file available in the source file.)1. Launch Sothink SWF Quicker.
2. In the blank document, rename Layer 1 as Bottom Border, add a keyframe in Frame 1 to place a background border.
3. Create a new layer 2, rename it as Banner Frame, and add a keyframe in Frame 1 to put a banner.
(Now a background frame in layers 1 (Bottom Border) and 2 (Banner Frame) has finished.)
4. Add another layer 3, rename it as Preloader. Create a movie clip ("mc") in Frame 1. In the example, a very simple movie clip is used with 3 layers: a layer containing text explaining what was happening, and 2 layers for a masking effect with the word "Loading ....".
It is to display the preloading message before the flash movie is completely downloaded.
5. Add layer 4 and rename it as Main Movie to place the main movie in Frame 4. When all movie frames loaded, the main movie shall start.
6. Add layer 5 and rename it as Text. Use Text tool to input %. And use Text tool again to draw a text block. Set this block text as "Dynamic" and input "textvar" in Var box.
7. Finally add an action layer consisting of the following 3 key frames:
Action Layer - key frame 1 action script:
Code:
if (_framesloaded >= _totalframes) {gotoAndPlay (3);
} else {
_root.textvar = int((_framesloaded/_totalframes)*100);
}
Action Layer - key frame 2 action script:
Code:
{gotoAndPlay(1);
}
Action Layer - key frame 135 action script (the last frame in the example movie):
{
stop();
Replay
Leave a Reply
Hot
-
2011-07-20 20:25:49,30145 read
-
2011-06-12 02:05:37,11636 read
-
2009-11-28 02:02:08,7861 read
-
2009-11-12 02:37:14,6867 read
-
2009-10-12 08:24:35,6585 read
-
2011-10-26 20:27:20,5441 read
-
2009-11-26 08:08:23,4743 read
-
2011-08-22 21:13:04,4439 read
-
2010-08-03 20:59:53,4248 read
-
2009-08-08 21:04:25,3833 read
