MovieClip
+--mx.core.UIObject
+--mx.core.UIComponent
+--mx.controls.MediaControllerMediaController contains the playback controls for controlling streaming media files.
_activePlayControl, _animating, _animationOpen, _animationStart, _backgroundStyle, _buttons, _chrome, _closeId, _controllerPolicy, _deadPreview, _enabled, _horizontal, _isOpen, _isPlaying, _lastProgressMediaType, _listenForPlayheadMoveEvent, _loadBar, _loadPercent, _miniPlayBar, _notAnimating, _openId, _openUpOrLeft, _playBar, _playPercent, _playTime, _priorMouseOver, _priorPolicy, _screenAccommodator, _secondChrome, _secondChromeClosedHeight, _secondChromeClosedWidth, _secondChromeFixedEnd, _secondChromeOpenHeight, _secondChromeOpenWidth, _strings, _volume, _volumeControl, activePlayControl, ANIMATION_TIME, backgroundStyle, className, clipParameters, CLOSE_DELAY, CLOSED_HORIZONTAL_HEIGHT, CLOSED_VERTICAL_WIDTH, controllerPolicy, enabled, expanded, H_BORDER, horizontal, lastProgressMediaType, LOADBAR_HORIZONTAL_CLOSED_Y, LOADBAR_HORIZONTAL_OPEN_Y, LOADBAR_VERTICAL_CLOSED_X, LOCALIZED_FILE, MINIMUM_HORIZONTAL_OPEN_HEIGHT, MINIMUM_HORIZONTAL_WIDTH, MINIMUM_VERTICAL_HEIGHT, MINIMUM_VERTICAL_OPEN_WIDTH, MINIPLAYBAR_VERTICAL_CLOSED_X, OPEN_DELAY, playAtBeginning, playing, playPercent, playTime, symbolName, symbolOwner, V_BORDER, volumeclipParameters, drawFocus, enabled, focusEnabled, focusManager, focusTextField, groupName, height, kStretch, mergedClipParameters, origBorderStyles, origBorderValues, popUp, symbolName, symbolOwner, tabEnabled, tabIndex, width__height, __onUnload, __width, _color, _endInit, _id, _maxHeight, _maxWidth, _minHeight, _minWidth, _preferredHeight, _preferredWidth, _tf, _topmost, addEventListener, bottom, buildDepthTable, changeColorStyleInChildren, changeTextStyleInChildren, childrenCreated, className, clipParameters, color, createAccessibilityImplementation, createChildAtDepth, createClassChildAtDepth, createEvent, dispatchEvent, embedFonts, findNextAvailableDepth, fontFamily, fontSize, fontStyle, fontWeight, handleEvent, height, idNames, ignoreClassStyleDeclaration, initProperties, invalidateFlag, left, lineColor, lineWidth, marginLeft, marginRight, methodTable, minHeight, minWidth, notifyStyleChangeInChildren, removeEventListener, right, scaleX, scaleY, setStyle, stylecache, styleName, symbolName, symbolOwner, tabEnabled, textAlign, textColorList, textDecoration, textIndent, tfList, top, validateNow, visible, width, x, y_alpha, _currentframe, _droptarget, _focusrect, _framesloaded, _height, _lockroot, _name, _parent, _quality, _rotation, _soundbuftime, _target, _totalframes, _url, _visible, _width, _x, _xmouse, _xscale, _y, _ymouse, _yscale, enabled, focusEnabled, hitArea, tabChildren, tabEnabled, tabIndex, tooltipText, trackAsMenu, useHandCursorstatic symbolName:Stringstatic symbolOwner:ObjectclassName:StringclipParameters:Objectstatic private MINIMUM_HORIZONTAL_WIDTH:Numberstatic private CLOSED_HORIZONTAL_HEIGHT:Numberstatic private MINIMUM_HORIZONTAL_OPEN_HEIGHT:Numberstatic private LOADBAR_HORIZONTAL_CLOSED_Y:Numberstatic private LOADBAR_HORIZONTAL_OPEN_Y:Numberstatic private MINIMUM_VERTICAL_HEIGHT:Numberstatic private CLOSED_VERTICAL_WIDTH:Numberstatic private MINIMUM_VERTICAL_OPEN_WIDTH:Numberstatic private LOADBAR_VERTICAL_CLOSED_X:Numberstatic private MINIPLAYBAR_VERTICAL_CLOSED_X:Numberstatic private ANIMATION_TIME:Numberstatic private CLOSE_DELAY:Numberstatic private OPEN_DELAY:Numberstatic private LOCALIZED_FILE:Stringstatic private H_BORDER:Numberstatic private V_BORDER:Numberprivate _deadPreview:MovieClipprivate _controllerPolicy:Stringprivate _horizontal:Booleanprivate _buttons:MovieClipprivate _loadBar:LoadBarprivate _playBar:PlayBarprivate _miniPlayBar:MiniPlayBarprivate _volumeControl:VolumeControlprivate _chrome:Chromeprivate _backgroundStyle:Stringprivate _isOpen:Booleanprivate _priorMouseOver:Booleanprivate _animationStart:Numberprivate _animationOpen:Booleanprivate _closeId:Numberprivate _openId:Numberprivate _notAnimating:Booleanprivate _animating:Booleanprivate _listenForPlayheadMoveEvent:Booleanprivate _activePlayControl:Stringprivate _isPlaying:Booleanprivate _volume:Numberprivate _playPercent:Numberprivate _playTime:Numberprivate _loadPercent:Numberprivate _strings:Objectprivate _secondChrome:Chromeprivate _secondChromeClosedHeight:Numberprivate _secondChromeOpenHeight:Numberprivate _secondChromeClosedWidth:Numberprivate _secondChromeOpenWidth:Numberprivate _secondChromeFixedEnd:Booleanprivate _openUpOrLeft:Booleanprivate _enabled:Booleanprivate _priorPolicy:Stringpublic playAtBeginning:Booleanprivate _lastProgressMediaType:Stringpublic lastProgressMediaType:String [Read Only]private _screenAccommodator:ScreenAccommodatorpublic expanded:Boolean [Read Only]public controllerPolicy:StringIndicates how the controller behaves wrt mouse interaction. 3 allowable settings: on: always expanded off: always contracted (must be expanded programmatically) auto: initially contracted. expands when mouse rolls over, contracts when mouse rolls off.
public horizontal:Booleanpublic volume:Numberpublic backgroundStyle:StringShould the component draw chrome?
public activePlayControl:StringThe active play control must be either play or pause. It must be writable so it can be set by the properties inspector. It only pertains to the starting state of the component and should *not* be written under normal circumstances.
public playing:Booleanpublic playTime:Numberpublic playPercent:Numberpublic enabled:Booleanprivate function initializeParameters():VoidCreate default values for absent parameters
private function drawChrome(wi:Number, he:Number):VoidDraw the chrome for the controller.
- Parameters
public function addSecondChrome(theChrome:Chrome, closedHeight:Number, openHeight:Number, closedWidth:Number, openWidth:Number, fixedEnd:Boolean):VoidAdd a second chrome to the control. This is used to allow the controller to animate the chrome of the player in auto mode.
public function removeSecondChrome():VoidRemove the second chrome instance from the controller.
public function onMouseMove():VoidManually monitor mouse movement. It would be nice to use the onRollOver and onRollOut functions but those will prevent mouse events from reaching the contained clips. No good. Instead we manually track mouse movement.
public function expand(force:Boolean):VoidIf policy is auto for this clip, expand the controller. Otherwise, do nothing. Unless forced.
public function contract(force:Boolean):VoidIf policy is auto for this clip, contract it. Otherwise, do nothing. Unless forced.
private function animate():VoidAnimate the transition. This is called as an onEnterFrame function.
private function sizeMainChrome(portion:Number):VoidSize the main chrome according to the portion parameter.
- Parameters
portionA number between 0 and 1 (inclusive) indicating how far along the animation has progressed.
private function animateBars(portion:Number):VoidMove and size the load and play bars during the opening and closing animations.
public function getLoadPercent():NumberThis function is only for the internal use of the the controller. It is public so that subclips can access it.
public function broadcastEvent(eventType:String, detailArg):VoidBroadcast an event.
- Parameters
eventTypeThe type of event (play, stop, pause, etc) detailArgAn additional parameter for the specific event type
public function handleEvent(ev:Object):VoidHandle events for which the controller listens
public function isListeningForPlayheadMoveEvent():Boolean
- Return
- True if the controller is listening for playhead move events. False if not.
public function setListeningForPlayheadMoveEvent(listen:Boolean):Void
- Return
- True if the controller is listening for playhead move events. False if not.
private function handleChangeEvent(ev:Object):VoidHandle a change event. Position the playbar to show the the current play position. Save the data in the controller so the playbar can subsequently be initialized properly.
private function handleProgressEvent(ev:Object):VoidHandle a progress event. Position the load bar to show the percentage of the media that has loaded.
public function evaluateToEnd():VoidEnable or disable the toEnd button, as appropriate.
private function handleUnrecognizedEvent(ev:Object):VoidHandle an unrecognized event
private function createDefaultStrings():VoidCreate default localized strings to use (a) while loading occurs or (b) if loading fails.
public function getLocalizedString(id:String):String
- Parameters
- Return
- The value of the string
public function associateDisplay(d:MediaDisplay):VoidAssociated this controller with a display. Set up the event listeners between the two.