Flash CS4 ActionScript 3.0 Tutorial
How to Add Video Clips to Your Flash Project
Delivering video on the Flash platform is very effective. There are two basic methods for adding video to your fla file. The first method adds the video to the timeline and the movie becomes embedded into the final swf file.
The second establishes a link to an external fla or f4v file. Because the file is linked, it is necessary to include the external file when uploading your swf file to the server.
In this example we will display a QuickTime file using the link method. Note that the QuickTime file must first be converted to a flv file before you can import it to the timeline. This technique utilizes the FLVPlayback Component.
A flv file in a separate folder named Video
Open a new Flash document and name the default layer Video.
Save your .fla file in a folder called Project. Name the file Main.fla.
Add a new folder in the Project folder called Video.
Add a flv file named Movie01.flv to the Video folder. For instructions on creating a flv file, see topic, Converting a Movie to a flv File.
Return to the fla file and select frame one of the Video layer, then open the Components panel (Window > Components).
Open the Video folder in the Components panel and double-click the FLVPlayback Component to add it to the center of the stage.
With the FLVPlayback Component selected, open the Component Inspector panel (Window > Component Inspector).
Click the value in the Skin row, then click the icon to select a new skin.
Click the color swatch in the skinBackgroundColor row, then select a new color for your skin.
Change the value in the Source row to Video/Movie01.flv. This is the path to your external flv file. You could also click the Browse icon and find your file.
Test your movie by pressing Cmd/Return (PC - Ctrl/Enter). The movie appears and plays in your swf file. Notice that the movie is timeline independent. The main timeline has only one frame, yet the movie plays to the end.