The MediaController control complements the MediaDisplay control by providing a user interface that controls media playback using standard controls such as play and pause. The MediaController never loads or plays back media itself, instead it controls playback in a mediaPlayback or MediaDisplay control. The MediaController control features a "drawer" which exposes the contents of the playback controls when the user positions the mouse over it.
MXML Syntax
The <mx:MediacController> tag inherits all the properties of its parent classes, and the following properties:
<mx:MediaController>
activePlayControl = "true|false"
associatedDisplay = "No default."
backgroundStyle = "default|none"
controllerPolicy = "auto|on|off"
enabled="true|false"
horizontal = "true|false"
playAtBegining = "true|false"
volume="75"
click = "Event handler. No default."
playheadChange = "Event handler. No default."
volumeChange = "Event handler. No default."
/>
| Constructors | |
MediaController
()
Constructor. |
|
| Methods | |
| addSecondChrome(theChrome:Chrome, closedHeight:Number, openHeight:Number, closedWidth:Number, openWidth:Number, fixedEnd:Boolean) : Void
Adds a second chrome to the control. |
| associateDisplay(d:MediaDisplay) : Void
Associates this MediaController control with a MediaDisplay control and sets up the event listeners between the two. |
| broadcastEvent(eventType:String, detailArg) : Void
Broadcasts an event. |
| contract(force:Boolean) : Void
If the policy is auto for this clip, contract the controller. |
| evaluateToEnd() : Void
Enable or disable the Go to End button. |
| expand(force:Boolean) : Void
If the policy is auto for this clip, expand the controller. |
| getLoadPercent() : Number
This function is for the internal use of the controller only. |
| getLocalizedString(id:String) : String
Gets the localized string. |
| handleEvent(ev:Object) : Void
Handles events for which the controller listens. |
| init() : Void
Initializes the controller. |
| isListeningForPlayheadMoveEvent() : Boolean
Determines whether the controller is listening for playhead move events. |
| isScrubbing() : Boolean
Determines whether the user is moving the thumb on the playback bar back and forth. |
| measure() : Void
Sets the preferred measurements of the component. |
| onMouseMove() : Void
Manually tracks mouse movement. |
| removeSecondChrome() : Void
Remove the second chrome instance from the controller. |
| setListeningForPlayheadMoveEvent(listen:Boolean) : Void
If true, the controller is listening for playhead move events. |
| Methods inherited from class mx.core.UIComponent |
getFocus
setFocus
getFocusManager
|
| Properties | |
static | version:String
MediaComponentVersion is for internal use only. |
| playAtBeginning:Boolean
If true, starts playing at the beginning of the media when the user clicks the Play button. |
| controllerPolicy:String
[Read-Write]
Indicates how the controller behaves upon mouse interaction. |
| horizontal:Boolean
[Read-Write]
If true, displays the control with a horizontal setting, and tracks the media from left to right. |
| volume:Number
[Read-Write]
The volume level, specified by an integer from 0 to 100. |
| backgroundStyle:String
[Read-Write]
If set to default, the component draws the chrome background. |
| activePlayControl:String
[Read-Write]
Specifies the play state of the associated MediaDisplay control when loaded at runtime. |
| playing:Boolean
[Read-Write]
Determines whether the controller is currently playing media. |
| associatedDisplay:Void
[Write-Only]
MediaDisplay control associated with the MediaController control. |
| enabled:Void
[Write-Only]
If true, enable this component. |
| Properties inherited from class mx.core.UIComponent |
version
enabled
tabIndex
|
| Effects |
| Effects inherited from class mx.core.UIComponent |
showEffect
hideEffect
focusInEffect
focusOutEffect
|
| Effects inherited from class mx.core.UIObject |
creationCompleteEffect
moveEffect
resizeEffect
mouseDownEffect
mouseOverEffect
mouseOutEffect
mouseUpEffect
|
| Events | |
click | Broadcasts when the user clicks the Play/Pause button. The event object contains the properties: - detail, which contains the string pause or play. - target, which contains a reference to the control. - type, which contains the string click. |
playheadChange | Broadcasts when a user moves the playback slider or clicks the Go to Beginning or Go to End button. the event object contains the following properties: - detail, which contains a number with the percent completed. - type, which contains the string playheadChange. |
volumeChange | Broadcasts when the user adjusts the volume. In MXML, use volumeChange as the property name. In ActionScript, use volume. The event object contains the following properties: - detail, which contains an integer between 0 (minimum) and 100 (maximum) to indicate volume. - type, which contains the string volume. |
scrubbing | Broadcasts when the user moves the thumb on the playback bar back and forth. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
| Events inherited from class: mx.core.UIComponent |
focusIn
focusOut
keyDown
keyUp
show
hide
valid
invalid
valueCommitted
|
| Styles |
| Styles inherited from class mx.core.UIObject |
color
fontFamily
fontSize
fontStyle
fontWeight
textAlign
textDecoration
textIndent
marginLeft
marginRight
horizontalGap
verticalGap
|
| Constructor Detail |
MediaController()
| Method Detail |
addSecondChrome(theChrome:Chrome, closedHeight:Number, openHeight:Number, closedWidth:Number, openWidth:Number, fixedEnd:Boolean) : Void
Parameters
theChrome - Chrome background to use.
closedHeight - Height when the MediaController controller is collapsed.
openHeight - Height when the MediaController controller is expanded.
closedWidth - Width when the MediaController controller is collapsed.
openWidth - Width when the MediaController controller is expanded.
fixedEnd - How the chrome is positioned when the component is resized. If the controller is at the bottom or right, the beginning is fixed. If the controller is positioned as the left or top, the end of the controller is fixed.
associateDisplay(d:MediaDisplay) : Void
Parameters
d - Display instance.
broadcastEvent(eventType:String, detailArg) : Void
Parameters
eventType - The type of event, such as play, stop, or pause.
detailArg - The specific event type.
contract(force:Boolean) : Void
Parameters
force - If true, contract the controller.
evaluateToEnd() : Void
expand(force:Boolean) : Void
Parameters
force - If true, expand the controller.
getLoadPercent() : Number
getLocalizedString(id:String) : String
Parameters
id - ID of the string to retrieve.
Returns
Value of the string.
handleEvent(ev:Object) : Void
Parameters
ev - Event.
init() : Void
isListeningForPlayheadMoveEvent() : Boolean
Returns
True if the controller is listening for playhead move events.
isScrubbing() : Boolean
measure() : Void
onMouseMove() : Void
removeSecondChrome() : Void
setListeningForPlayheadMoveEvent(listen:Boolean) : Void
Parameters
listen - Whether to listen for playhead move events.
| Property Detail |
activePlayControl:String
[Read-Write]
associatedDisplay:Void
[Write-Only]
backgroundStyle:String
[Read-Write]
controllerPolicy:String
[Read-Write]
enabled:Void
[Write-Only]
horizontal:Boolean
[Read-Write]
playAtBeginning:Boolean
playing:Boolean
[Read-Write]
static version:String
volume:Number
[Read-Write]