Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > Media components > Media class | |||
Inheritance MovieClip > UIObject class > UIComponent class > Media
ActionScript Class Names mx.controls.MediaController, mx.controls.MediaDisplay, mx.controls.MediaPlayback
Each component class has a version property, which is a class property. Class properties are available only for the class itself. The version property returns a string that indicates the version of the component. To access this property, use the following code:
trace(mx.controls.MediaPlayback.version);
|
NOTE |
|
The code |
The following table lists methods of the Media class.
|
Method |
Components |
Description |
|---|---|---|
|
MediaDisplay, MediaPlayback |
Adds a cue point object to the component instance. |
|
|
MediaDisplay |
Associates a MediaDisplay instance with a MediaController instance. |
|
|
MediaController |
Associates a MediaController instance with a MediaDisplay instance. |
|
|
MediaPlayback |
Converts the component instance to full-screen playback mode. |
|
|
MediaPlayback |
Converts the component instance back to its original screen size. |
|
|
MediaDisplay, MediaPlayback |
Returns a cue point object. |
|
|
MediaDisplay, MediaPlayback |
Pauses the playhead at its current location in the media timeline. |
|
|
MediaDisplay, MediaPlayback |
Plays the media associated with the component instance at a given starting point. |
|
|
MediaDisplay, MediaPlayback |
Deletes all cue point objects associated with a given component instance. |
|
|
MediaDisplay, MediaPlayback |
Deletes a specified cue point associated with a given component instance. |
|
|
MediaDisplay, MediaPlayback |
Sets the media type and path to the specified media type. |
|
|
MediaDisplay, MediaPlayback |
Stops the playhead and moves it to position 0, which is the beginning of the media. |
The following table lists properties of the Media class.
|
Property |
Components |
Description |
|---|---|---|
|
MediaController |
Determines the component state when loaded at runtime. |
|
|
MediaDisplay, MediaPlayback |
Determines if the component instance maintains its video aspect ratio. |
|
|
MediaDisplay, MediaPlayback |
Determines if the component instance immediately starts to buffer and play. |
|
|
MediaDisplay, MediaPlayback |
Determines the size of the media-viewing portion of the MediaDisplay or MediaPlayback component. |
|
|
MediaController |
Determines if the component instance draws its chrome background. |
|
|
MediaDisplay, MediaPlayback |
Read-only; the number of bytes loaded that are available for playing. |
|
|
MediaDisplay, MediaPlayback |
The number of bytes to be loaded into the component instance. |
|
|
MediaDisplay, MediaPlayback |
A string that holds the relative path and filename of the media to be streamed and played. |
|
|
MediaController, MediaPlayback |
Determines whether the controller is hidden when instantiated and only appears when the user moves the mouse over the controller's collapsed state. |
|
|
MediaPlayback |
Determines where the component's controls are positioned. |
|
|
MediaDisplay, MediaPlayback |
An array of cue point objects that have been assigned to a given component instance. |
|
|
MediaController |
Determines the orientation of the component instance. |
|
|
MediaDisplay, MediaPlayback |
Determines the type of media to be played. |
|
|
MediaDisplay, MediaPlayback |
Holds the current position of the playhead (in seconds) for the media timeline that is playing. |
|
|
MediaDisplay, MediaPlayback, MediaController |
For MediaDisplay and MediaPlayback, this property is read-only and returns a Boolean value to indicate whether a given component instance is playing media. For MediaController, this property is read/write and controls the image (playing or paused) displayed on the Play/Pause button of the controller. |
|
|
MediaDisplay, MediaPlayback |
The default value of the height of a FLV file. |
|
|
MediaDisplay, MediaPlayback |
The default value of the width of a FLV file. |
|
|
MediaDisplay, MediaPlayback |
An integer that indicates the total length of the media, in seconds. |
|
|
MediaDisplay, MediaPlayback |
An integer from 0 (minimum) to 100 (maximum) that represents the volume level. |
The following table lists events of the Media class.
|
Event |
Components |
Description |
|---|---|---|
|
MediaDisplay, MediaPlayback |
Broadcast continuously while media is playing. |
|
|
MediaController, MediaPlayback |
Broadcast when the user clicks the Play/Pause button. |
|
|
MediaDisplay, MediaPlayback |
Notification that the playhead has reached the end of the media. |
|
|
MediaDisplay, MediaPlayback |
Notification that the playhead has reached a given cue point. |
|
|
MediaController, MediaPlayback |
Broadcast by the component instance when a user moves the playback slider or clicks the Go to Beginning or Go to End button. |
|
|
MediaDisplay, MediaPlayback |
Generated continuously until the media has downloaded completely. |
|
|
MediaController, MediaPlayback |
Generated when the playhead is dragged. |
|
|
MediaController, MediaPlayback |
Broadcast when the user adjusts the volume. |
Flash CS3