User Guide
198 Chapter 10: Working with Video
3.
Open the Component inspector set the following parameters:
ActivePlayControl sets the playbar in Play or Pause when the SWF file opens. Use this
parameter with Automatically Play in the MediaDisplay component.
BackgroundStyle indicates whether the background of the controller appears as default or
as none.
ControllerPolicy determines whether the Controller opens or closes based on mouse position
or is locked in the open or closed state.
Horizontal determines whether the Controller orientation is vertical or horizontal.
Enabled lets the user access the playback controls.
Visible lets the user see the Controller.
MinHeight sets the minimum height (in pixels) allowable for this instance.
MinWidth sets the minimum width (in pixels) allowable for this instance.
The media components use events to interact with other elements in a Flash document, including
each other. The MediaController instance broadcasts events when its buttons are clicked or its
sliders are dragged. The MediaDisplay instance broadcasts events when playback starts and
finishes, the playhead moves, media is downloaded from the source, and when cue points are
passed by the playhead.
In order for the MediaController and MediaDisplay instances to work together, they must listen
for events from each other and respond appropriately. For example, when a user clicks the Pause
button on the MediaController, it broadcasts a “click” event with a detail property of “pause.”
When the MediaDisplay instance receives the event, it responds by pausing playback.
Flash MX Professional 2004 includes two behaviors, Associate Controller and Associate Display,
that connect the MediaDisplay and MediaController components instances. Only one of the
two behaviors is necessary to link the two components. The end result is identical with
either behavior.
To link a MediaDisplay instance to a MediaController instance:
1.
With a MediaDisplay instance and a MediaController instance added to your document (for
more information, see “To add a MediaDisplay component to a Flash document:” on page 197
and “To add a MediaController to a Flash document:” on page 197), select the MediaDisplay
instance.
2.
In the Behaviors panel (Window > Development Panels > Behaviors), click the Add (+) button
and select the Associate Controller behavior from the Media submenu.
3.
In the Associate Controller dialog box, browse to the location of the MediaController
instance and select it. If you have not named the instance, you will be asked to enter a name;
click OK.
The behavior inserts the code that enables the component instances to listen to each other.