Creating an application with the FLVPlayback component


You can include the FLVPlayback component in your application in the following ways:

  • Drag the FLVPlayback component from the Components panel to the Stage, and specify a value for the contentPath parameter.
  • Use the Video Import wizard to create the component on the Stage, and customize it by selecting a skin.
  • Use the MovieClip attachMovie() method to dynamically create an FLVPlayback instance on the Stage, assuming the component is in the library.

To drag the FLVPlayback component from the Components panel:

  1. In the Components panel, click the Plus (+) button to open the FLV Playback – Player 8 entry.
  2. Drag the FLVPlayback component to the Stage.
  3. With the FLVPlayback component selected on the Stage, locate the Value cell for the contentPath parameter in the Parameters tab of the Component inspector, and enter a string that specifies one of the following:
    • A local path to an FLV file
    • A URL to an FLV file
    • A URL to an XML file that describes how to play an FLV file

    For information on how to create an XML file to describe one or more FLV files, see Using a SMIL file.

  4. On the Parameters tab in the Component inspector, with the FLVPlayback component selected on the Stage, click the Value cell for the skin parameter.
  5. Click the magnifying-glass icon to open the Select Skin dialog box.
  6. Select one of the following options:
    • From the drop-down Skin list, select one of the predesigned skins to attach a set of playback controls to the component.
    • If you created a custom skin, select Custom Skin URL from the pop-up menu, and enter, in the URL text box, the URL for the SWF file that contains the skin.
    • Select None, and drag individual FLV Playback Custom UI components to the Stage to add playback controls.
      NOTE In the first two cases, a preview of the skin appears in the viewing pane above the pop-up menu.
  7. Click OK to close the Select Skin dialog box.
  8. Select Test Movie from the Control menu to execute the SWF file and start the video.

To use the Video Import wizard:

  1. Select File > Import > Import Video.
  2. Indicate the location of the video file by selecting one of the following options:
    • On my local computer
    • Already deployed to a web, FCS, or FVSS server
  3. Depending on your choice, enter either the path or the URL that specifies the location of the video file; then click Next.
  4. If you selected a file path, you’ll see a Deployment dialog box next where you can select one of the options listed to specify how you would like to deploy your video:
    • Progressive download from a standard web server
    • Stream from Flash Video Streaming Service
    • Stream from Flash Communication Server
    • Embed video in SWF and play in timeline
    WARNING Do not select the Embed Video option. The FLVPlayback component plays only external streaming video. This option will not place an FLVPlayback component on the Stage.
  5. Click Next.
  6. Select one of the following options:
    • From the drop-down Skin list, select one of the predesigned skins to attach a set of playback controls to the component.
    • If you created a custom skin for the component, select Custom Skin URL from the pop-up menu, and enter the URL for the SWF file that contains the skin in the URL text box.
    • Select None, and drag individual FLV Playback Custom UI components to the Stage to add playback controls.
      NOTE In the first two cases, a preview of the skin appears in the viewing pane above the pop-up menu.
  7. Click OK to close the Select Skin dialog box.
  8. Read the Finish Video Import dialog box to note what happens next, and then click Finish.
  9. If you have not saved your FLA file, a Save As dialog box appears.
  10. Select Test Movie from the Control menu to execute the SWF file, and start the video.

To create an instance dynamically using ActionScript:

  1. Drag the FLVPlayback component from the Components panel to the Library (Window > Library).
  2. Add the following code to the Actions panel on Frame 1 of the Timeline. Change install_drive to the drive on which you installed Flash 8 and modify the path to reflect the location of the Skins folder for your installation:
    import mx.video.*;
    this.attachMovie("FLVPlayback", "my_FLVPlybk", 10, {width:320, height:240, x:100, y:100});
    my_FLVPlybk.skin = "file:///install_drive|/Program Files/Macromedia/Flash 8/en/Configuration/Skins/ClearOverPlaySeekMute.swf"
    my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";

    The attachMovie() method belongs to the MovieClip class. You can use it create an instance of the FLVPlayback component because the FLVPlayback class extends the MovieClip class.

    NOTE Without setting the contentPath and skin properties, the generated movie clip will appear to be empty.
  3. Select Test Movie from the Control menu to execute the SWF file and start the FLV file.

———————————————————————————————-

This doesn’t work:
this.attachMovie(“FLVPlayback”, “my_FLVPlybk”, 10, {width:320, height:240, x:100, y:100});

The width and height parameters are not applied. The x and y parameters are applied correctly.

This works:
this.attachMovie(“FLVPlayback”, “my_FLVPlybk”, 10, {_width:320, _height:240, x:100, y:100});

The width and height parameters are applied correctly. The x and y parameters are applied correctly.

This also works:
this.attachMovie(“FLVPlayback”, “my_FLVPlybk”, 10, {_width:320, _height:240, _x:100, _y:100});

The width and height parameters are applied correctly. The x and y parameters are applied correctly.

Why?

It’s because the FLVPlayback is a component and extends the movieclip class?
———————————————————————————————-

I got the code to work just fine…
this.attachmovie(“FLBPlybk”, “myFLVPlybck.”, this.getNextHighestDepth());
myFLVPlybck.contentpath = _level0.datareadinfromfile;
myFLVPlybck.autoSize = true;
myFLVPlybck.autoPlay = true;

However, my problem is that this is a generalized player and each symbol may or may not play an flv, depending on need. I got this running fine by including the code in the instance of each symbol. But my bosses prefer to have it all in a class so that any changes to the code need only be done once. I have tried creating a class. It instantiates just fine but doesn’t seem to play the flv.
———————————————————————————————-

source:

http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00003479.html#3795136

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s