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:

Flash Player Process Lifecycle
Flash Player Process Lifecycle

Table of Contents

 About This Book

 Introduction of Adobe Flash

 Adobe Flash Player Plugin for Firefox

 Adobe Flash Player Plugin for Chrome

 Adobe Flash Player Plugin for Safari

 Adobe Flash Player ActiveX for IE

 Using "object" Elements for Flash Files

 Using "embed" Elements for Flash Files

 "mp3player" - MP3 Music Player

 SWFObject - Hidding "object" behind JavaScript

 Flash Player Projector

 SWFTools - SWF File Manipulation Tools

 SWFC Script to Generate Flash SWF Files

 ActionScript Embedded in SWFC Script

 AS3Compile - ActionScript 3 Compiler

 Adobe Flex SDK 4

 SWF File Structure and Tags

SWF File Processing Rules

Flash Player Lifecycle - Timeline and Frame Rate

 SWF Tag Process Flow - SHOWFRAME Synchronization

 SWF Player Lifecycle Example

 Showing SWF Tag Details - "swfdump --full"

 Flash Player Supports Dynamic Actions

 Action Instruction Example - "GotoFrame"

 Creating Display Objects with Action Instructions

 More Action Instructions and Less SWF Tags

 SWF Files for Video and Audio Streams

 Outdated Tutorials

 References

 Full Version in PDF/EPUB