![]() | ![]() ![]() ![]() |
![]() | |
![]() | |
![]() |
With Flash MX Professional 2004 media components, you can quickly and easily add Flash video and playback controls to your documents. Then, using cue points, you can synchronize your video with animation, text, and graphics. For example, you can create a Flash presentation that has video playing in one area of the screen while text and graphics are displayed in another area. A cue point placed in the video triggers an update to the text and graphic, enabling them to remain relevant to the content of the video.
The media component suite consists of three components: MediaDisplay, MediaController, and MediaPlayback. With the MediaDisplay component, adding media to your Flash documents is as simple as dragging the component to the Stage and configuring it in the Component Inspector panel. In addition to setting the parameters in the Component Inspector panel, you can add cue points to trigger other actions. The MediaDisplay component has no visual representation during playback. Only the video clip is visible. For more information, see MediaDisplay component..
The MediaController component provides user interface controls that let the user interact with streaming media. The Controller features Play, Pause, and Rewind to Start buttons and a volume control. It also includes playbars that show how much of the media has loaded, and how much has played. A playhead slider can be dragged forward and backward on the playbar to navigate quickly to different parts of the video. Using Behaviors or ActionScript, you can easily link this component to the MediaDisplay component to display streaming video and provide user control. See MediaController component.
The MediaPlayback component provides the easiest and quickest way to add video and a controller to your Flash documents. The MediaPlayback component combines the MediaDisplay and MediaController components into a single, integrated component. The MediaDisplay and MediaController component instances are automatically linked to each other for playback control. For more information, see MediaPlayback component.
You use the Component Inspector panel to configure parameters for playback, size, and layout for all three components. All the media components work equally well with MP3 audio content.
Video Length is used by the playbar component to determine progress of the playback.
Milliseconds determines whether the playbar and cue points use frames or milliseconds.
fps sets the number of frames per second for video playback. When Milliseconds is selected, the frames per second control is disabled.
URL sets the path and filename or URL for the media.
Automatically Play sets the media to play as soon as it is available.
Use Preferred Media Size displays the FLV video clip at its native size and aspect ratio. When deselected, the media conforms to the height and width set in the component inspector.
Respect Aspect Ratio retains the original aspect ratio of the media when selected.
Control Placement determines if the controller will sit above, below, to the right or to the left of the video clip.
Control Visibility determines whether the Controller opens or closes based on mouse position, or is locked in the open or closed state.
Video Length is used by the playbar component to determine progress of the playback.
Milliseconds determines whether the playbar and cue points use frames or milliseconds.
fps sets the number of frames per second for video playback. When Milliseconds is selected, the frames per second control is disabled.
URL sets the path and filename or URL for the media.
Automatically Play sets the media to play as soon as it is available.
Use Preferred Media Size displays the FLV video clip at it's native size and aspect ratio. When deselected, the media conforms to the height and width set in the component inspector.
Respect Aspect Ratio retains the original aspect ratio of the media when selected.
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 displays 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 allows the user to access the playback controls.
Visible allows the user to 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.
The behavior inserts the code that enables the component instances to listen to each other.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |