Flash Tutorials - Herong's Tutorial Examples - v3.03, by Dr. Herong Yang
Flash Player Lifecycle - Timeline and Frame Rate
This section describes Flash Player lifecycle which is controlled by the timeline and the frame rate.
In previous tutorials, we learned that a SWF file consists of mainly definition tags and control tags. When Flash Player opens a SWF file, it will process (or play) those tags sequentially using 3 primary concepts: Timeline, Show Frame, and Frame Rate.
Using above concepts, Flash Player follows a simple lifecycle when processing (or playing) a SWF file:
1. Set up the frame rate given in the SWF file. For example, frame rate = 24 fps.
2. Prepare a display list with items to be rendered.
3. Show the initial frame by rendering all items in the display list, including showing graphics and/or playing sounds.
4. Wait for the next show-frame time, which the previous Show Frame time plus the frame rate interval time. For example, if frame rate is 24 fps, the wait time is about 1/24 seconds (about 0.04 seconds).
5. While waiting, update the display list by removing existing items and adding new items
6. At next Show Frame time, render all items in the display list.
7. Continue with step 4.
As you can see from the above algorithm, Flash Player uses concept called "PlayList" to support the "Display Frame" action.
"Play List" - Represents a collection of items to be rendered at the next "Display Frame" time. Play list items include graphical items to be painted on the screen and sound items to be played in the background.
In order to be more efficient, Flash Player also uses another concept called "Dictionary" to help building the "Play List".
"Dictionary" - Represents a collection of items called "Characters" which are used to build "Display List" items, or other "Characters". A "Character" can be a graphical shape, a text string, a sound, or a stream data, representing anything that Flash Player can support.
The picture below illustrates the Flash Player's processing lifecycle and how Timeline, Frame Rate, Show Frame, Display List and Dictionary are related to each other:
Table of Contents