Setting up your file to run the code samples
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:
- Create a folder on your desktop or select a location where you'd like to save your files. Save a copy of the FLV file from the sample files folder into this location.
- Create an ActionScript 3.0 FLA file using Flash CS3 Professional. Save the file next to the FLV file as described in the last step.
- Rename the default layer 1 to assets.
- Open the Components panel and drag an instance of the FLVPlayback component from the Video folder.
- Place the component on the stage and resize its dimensions as desired using the Free Transform tool.
- With the component selected, name the instance in the Property inspector.
- Create a new layer and name it actions.
- Select the keyframe on Frame 1 of the actions layer and open the Actions panel (F9).
- Copy the code example from the article or the sample file and paste it into the text editor of the Actions panel.
- Update the flvControl variable to the video component instance name you used and update the flvSource variable with the URL of your FLV file.
- Export the SWF (Control > Enter) or publish the movie to see the results.
|