Weblog / Blog article: Customizing FLVPlayback Components

Customizing FLVPlayback Components

This is from my talk, How to Shoot, Edit, and Publish Web Video, at MAX 2007. For more step-by-step tutorials purchase my book, Producing Flash CS3 Video.

To create a video player with the FLV playback components, follow these steps

  1. Download the example file custom-player.zip.
  2. Unarchive it, open the folder custom-player, and open the file custom-player.fla in Flash Professional CS3.
  3. Open the Components panel (Window > Components). Drag the FLVPlayback, PlayPauseButton, SeekBar, BufferingBar, MuteButton, and FullScreenButton components to the stage. Arrange them as you like.
    components panel
  4. Open the Library panel. Double-click any of the FLVPlayback components and then modify their appearance using the drawing tools in Flash. For any button there are states for normal, rollover, down and disabled states. Toggle buttons like PlayPauseButton combine two buttons into one and switch between the two when toggled. Feel free to explore the file custom-player-finished.fla to see how I customized the components.
    library panel
  5. Use the Properties Inspector panel to name each object on the stage.
    components panel

  6. Use the following table to name your components

    Component Type Instance Name
    FLVPlayback my_Video
    PlayPauseButton my_PlayPauseButton
    SeekBar my_SeekBar
    BufferingBar my_BufferingBar
    MuteButton my_MuteButton
    FullScreenButton my_FullScreenButton
  7. When you're finished, click the first frame in the Actions Layer.
    components panel
  8. Open the Actions window (Window > Actions) and type the following code:
     
    my_Video.playPauseButton = my_PlayPauseButton;
    my_Video.seekBar = my_SeekBar;
    my_Video.bufferingBar = my_BufferingBar;
    my_Video.muteButton = my_MuteButton;
    my_Video.fullScreenButton = my_FullScreenButton;
    my_Video.source = "seamonster.flv";
     
  9. Save the file. (File > Save).
  10. Add a flv file to the player. Select the video instance my_Video and using the Component Inspector, set the source parameter to seamonster.flv.

  11. Test the movie. (Control > Test Movie).

Comments are closed.