Using the MediaDisplay and MediaController components
If you want a lot of control over the look and feel of your media display, you may want to use the MediaDisplay and MediaController components together. The following example creates a Flash application that displays your CD and DVD preview media.
To create a Flash document that displays a CD or DVD preview:
- Select File > New and choose Flash File (ActionScript 2.0).
- From the Components panel, drag a MediaController and a MediaDisplay component to the Stage.
- Select the MediaDisplay instance and enter the instance name myDisplay in the Property inspector.
- Select the MediaController instance and enter the instance name myController in the Property inspector.
- Select the MediaDisplay instance, and open the Component inspector, Parameters tab. Set your media type according to the type of media that will be streaming (MP3 or FLV).
- If you selected FLV, enter the duration of the video in the Video Length text boxes using the format HH:MM:SS.
- Enter the location of your preview video in the URL text box. For example, you might enter www.helpexamples.com/flash/video/clouds.flv.
- Set the desired options for the Automatically Play, Use Preferred Media Size, and Respect Aspect Ratio check boxes.
- Select the MediaController instance and, in the Component inspector, Parameters tab, set your orientation to vertical by setting the
horizontal property to false.
- In the Component inspector, Parameters tab, set
backgroundStyle to none. This specifies that the MediaController instance should not draw a background but should instead fill the media between the controls.
Next, you'll use a behavior to associate the MediaController and MediaDisplay instances so that the MediaController instance accurately reflects the playhead movement and other settings in the MediaDisplay instance, and so that the MediaDisplay instance responds to user clicks.
- With the MediaController instance still selected, open the Behaviors panel (Window > Behaviors).
- In the Behaviors panel, click the Add (+) button, and select Media > Associate Display.
- In the Associate Display window, select
myDisplay under _root, and click OK.
For more information on using behaviors with media components, see Controlling media components by using behaviors.
Flash CS3