An Example of a Simple Preloader
Overview: 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(); |