This section provides a quick overview of what you'll need to know to begin customizing video playback with ActionScript 3. If you have previous experience using ActionScript 3 and working with FLA video and the FLVPlayback component, then you may wish to skip ahead to the following pages of this article. Otherwise, it is important that you have a full understanding of the following information to ensure you have the foundation needed to programmatically modify the FLVPlayback successfully.
You should be familiar with some of the following resources (beginning to intermediate) so that you understand encoding FLV and H.264 video and working with the FLVPlayback component:
To follow along with the instructions in this article, you will need to have an ActionScript 3 FLVPlayback component and an FLV or MPEG-4 file to use with the provided code examples.
Note: Video files encoded with the H.264 codec can be viewed using the ActionScript 3 FLVPlayback component if viewed in Flash Player 9,0,115 and later. H.264 video support includes a range of MPEG-4 formats: F4V, MP4, M4A, MOV, MP4V, 3GP, and 3G2.
Download the provided sample files and uncompress the folder to see working code examples that control a short FLV file. Notice that each of the files is set up consistently with two layers on the main timeline: assets and actions. The assets layer holds the FLVPlayback component (named "display") and the actions layer contains the code. Use the sample files as a guide to compare with the files you create or use them as a foundation to begin building your own project.
You'll need three things to get started; an FLV file, an FLVPlayback component instance, and an actions layer with a few lines of code. To use the code samples in this article, do the following:
Open the Components panel and drag an instance of the FLVPlayback component from the Video folder. Because you are working in an ActionScript 3 FLA file, the component available is the ActionScript 3 FLVPlayback component.
Note: While it is possible to create and position the FLVPlayback component and other UI components programmatically, the components must first be copied from the Components panel to the Library of the current FLA file. For the purposes of this article, I go one step further and suggest that you start your file by dragging an FLVPlayback component to the Stage, naming its instance, and positioning it visually as desired.
With the component selected, name the instance in the Property inspector.
Note: The examples in article use the instance name display for the FLVPlayback instance. Either use this instance name or change the name in your code to match the instance name of your video component.
Once you've run through the previous steps, you'll have a handful of files to work with including the FLV file, possibly an HTML file, the master FLA file, the SWF file, and the skin SWF file (if a skin is used). You will upload all of these files, except the FLA file, to the server for the deployment of progressive video.
For full details on the ActionScript 3 FLVPlayback API, see the FLVPlayback class section of the Flash CS4 Professional ActionScript 3.0 Language Reference.