Methods | Properties | Effects | Events | Styles Frames | No Frames

mx.controls
Class MediaController

Inheritance ImageInheritance Image


class MediaController
extends mx.core.UIComponent

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"
playPercent = "No default."
volume="75"
click = "Event handler. No default."
playheadChange = "Event handler. No default."
volumeChange = "Event handler. No default."
scrubbing = "Event handler. No default.
/>

See Also
    MediaDisplay
    MediaPlayback



Constructors
MediaController ( )
Constructor.



Methods
       associateDisplay( d: mx.controls.MediaDisplay) :  Void
Associates this MediaController control with a MediaDisplay control and sets up the event listeners between the two.
       contract( force: Boolean) :  Void
If the controllerPolicy is set to auto, contract, or collapse, the controller.
       expand( force: Boolean) :  Void
If the controllerPolicy property is set to auto, expand the controller.
       isScrubbing( ) :  Boolean
Determines whether the user is moving the thumb on the playback bar.

Methods inherited from class mx.core.UIComponent
drawFocus   getFocus   getFocusManager   setEnabled   setFocus  

Methods inherited from class mx.core.UIObject
addEventListener   applyProperties   buildDepthTable   commitProperties   constructObject2   createAccessibilityImplementation   createChildAtDepth   createChildren   createClassChildAtDepth   createClassObject   createEmptyObject   destroyObject   dispatchEvent   doLater   draw   drawRect   executeBindings   fillRect   findNextAvailableDepth   getRepeaterItem   getStyle   handleEvent   init   invalidate   invalidateLayout   invalidateProperties   invalidateSize   invalidateStyle   layoutChildren   measure   move   redraw   removeEventListener   setDepthAbove   setDepthBelow   setMask   setSize   setSizeNoLayout   setStyle   swapDepths  



Properties
       activePlayControl: String
Specifies the play state of the associated MediaDisplay control when loaded at runtime.
       associatedDisplay: var    [Write-Only]
The string name of the MediaDisplay control associated with the MediaController control.
       backgroundStyle: String
If set to default, the component draws the chrome background.
       controllerPolicy: String
Indicates how the controller behaves upon mouse interaction.
       expanded: Boolean    [Read-Only]
Returns true if the controller has been expanded.
       horizontal: Boolean
If true, displays the control with a horizontal setting, and tracks the media from left to right.
       playing: Boolean
Determines whether the controller is currently playing media.
       playPercent: Number
The percentage amount of the media that has already been played
       playTime: Number
The current playhead position in milliseconds
staticversion: String
MediaComponentVersion is for internal use only.
       volume: Number
The volume level, specified by an integer from 0 to 100.

Properties inherited from class mx.core.UIComponent
enabled   errorString   tabEnabled   tabIndex   version  

Properties inherited from class mx.core.UIObject
alpha   baselinePosition   className   depth   documentDescriptor   height   heightFlex   id   instanceIndices   isDocument   kStretch   layoutHeight   layoutWidth   maxHeight   maxWidth   minHeight   minWidth   mouseX   mouseY   nestLevel   oldHeight   oldWidth   oldX   oldY   parent   parentApplication   parentDocument   percentHeight   percentWidth   preferredHeight   preferredWidth   repeaterIndices   scaleX   scaleY   styleName   tabEnabled   toolTip   version   visible   width   widthFlex   x   y  



Effects

Effects inherited from class mx.core.UIComponent
focusInEffect   focusOutEffect  

Effects inherited from class mx.core.UIObject
creationCompleteEffect   hideEffect   mouseDownEffect   mouseOutEffect   mouseOverEffect   mouseUpEffect   moveEffect   resizeEffect   showEffect  



Events
clickBroadcasts when the user clicks the Play/Pause button. The event object contains the properties:
- detail contains the string pause or play.
- target contains a reference to the control.
- type contains the event name, click.
playheadChangeBroadcasts 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 contains a number with the percent completed.
- target contains a reference to the control.
- type contains the event name, playheadChange.
scrubbingBroadcasts when the user moves the thumb on the playback bar back and forth. The target property of the event object contains a reference to the component that triggered the event. The type property contains the name of the event, scrubbing.
volumeChangeBroadcasts 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 contains an integer between 0 (minimum) and 100 (maximum) to indicate volume.
- target contains a reference to the control.
- type contains the event name, volumeChange.

Events inherited from class: mx.core.UIComponent
focusIn  focusOut  invalid  keyDown  keyUp  valid  valueCommitted 

Events inherited from class: mx.core.UIObject
creationComplete  dragComplete  dragDrop  dragEnter  dragExit  dragOver  draw  effectEnd  effectStart  hide  hideToolTip  initialize  load  mouseChangeSomewhere  mouseDown  mouseDownSomewhere  mouseMove  mouseMoveSomewhere  mouseOut  mouseOver  mouseUp  mouseUpSomewhere  move  resize  show  showToolTip  unload 



Styles

Styles inherited from class mx.core.UIComponent
backgroundAlpha   backgroundColor   backgroundDisabledColor   backgroundImage   backgroundSize   barColor   borderCapColor   borderColor   borderSides   borderStyle   borderThickness   cornerRadius   disabledColor   dropShadow   errorColor   fillColors   highlightColor   modalTransparency   scrollTrackColor   selectedFillColors   shadowCapColor   shadowColor   shadowDirection   shadowDistance   symbolBackgroundColor   symbolBackgroundDisabledColor   symbolBackgroundPressedColor   symbolColor   symbolDisabledColor   themeColor  

Styles inherited from class mx.core.UIObject
color   fontFamily   fontSize   fontStyle   fontWeight   horizontalGap   leading   marginLeft   marginRight   textAlign   textDecoration   textIndent   verticalGap  



Constructor Detail

MediaController

MediaController( )

Constructor.



Method Detail

associateDisplay

associateDisplay( d: mx.controls.MediaDisplay) :  Void

Associates this MediaController control with a MediaDisplay control and sets up the event listeners between the two.

Parameters
    d: mx.controls.MediaDisplay - MediaDisplay instance.


contract

contract( force: Boolean) :  Void

If the controllerPolicy is set to auto, contract, or collapse, the controller. Otherwise, do nothing, unless force is true.

Parameters
    force: Boolean - If true, contract the controller.


expand

expand( force: Boolean) :  Void

If the controllerPolicy property is set to auto, expand the controller. Otherwise, do nothing, unless force is true.

Parameters
    force: Boolean - If true, expand the controller.


isScrubbing

isScrubbing( ) :  Boolean

Determines whether the user is moving the thumb on the playback bar.



Property Detail

activePlayControl

activePlayControl: String  

Specifies the play state of the associated MediaDisplay control when loaded at runtime. The default value is play, which plays the media file on load. Set this property to the same value as the autoPlay property of the associated MediaDisplay control.
Note: This property must be writable. However, it only pertains to the starting state of the component and should not be written under normal circumstances.


associatedDisplay

associatedDisplay: var   [Write-Only]

The string name of the MediaDisplay control associated with the MediaController control.


backgroundStyle

backgroundStyle: String  

If set to default, the component draws the chrome background. If set to none, the component does not draw the chrome background. The default value is default.


controllerPolicy

controllerPolicy: String  

Indicates how the controller behaves upon mouse interaction. Possible settings are on, off, and auto.
on The controller is always expanded.
off The controller is always contracted (collapsed) and can only be expanded programmatically.
auto The controller is initially contracted. It expands when the mouse rolls over, and then contracts when the mouse rolls off.


expanded

expanded: Boolean   [Read-Only]

Returns true if the controller has been expanded. Useful when the controllerPolicy property is set to auto.


horizontal

horizontal: Boolean  

If true, displays the control with a horizontal setting, and tracks the media from left to right. If false, displays with a vertical orientation, and tracks the media from bottom to top. The default value is true.


playing

playing: Boolean  

Determines whether the controller is currently playing media.


playPercent

playPercent: Number  

The percentage amount of the media that has already been played


playTime

playTime: Number  

The current playhead position in milliseconds


version

static  version: String  

MediaComponentVersion is for internal use only.


volume

volume: Number  

The volume level, specified by an integer from 0 to 100. The default is 75.


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/15/asdocs_en/mx/controls/MediaController.html