Main Page | Packages | Class Tree | Index | Help

mx.controls

class MediaController

Object
  |
  +--MovieClip
        |
        +--mx.core.UIObject
              |
              +--mx.core.UIComponent
                    |
                    +--mx.controls.MediaController


class MediaController
extends UIComponent

MediaController contains the playback controls for controlling streaming media files.


Author:
Andrew Guldman


Field Summary


clipParameters: Object


public
playAtBeginning: Boolean
Should a click on the play button start play at the beginning of the media? Must be public because the PlayPauseButton class needs to update it.

static
symbolName: String
This set of properties is for FUIComponent

static
symbolOwner: Object


static
version: String
Copyright (C) 2003 Macromedia, Inc.

Fields inherited from class mx.core.UIComponent

clipParameters, drawFocus, enabled, focusEnabled, focusManager, focusTextField, groupName, kStretch, mergedClipParameters, origBorderStyles, origBorderValues, popUp, symbolName, symbolOwner, tabEnabled, tabIndex, version

Fields inherited from class mx.core.UIObject

__height, __width, _color, _topmost, addEventListener, buildDepthTable, changeColorStyleInChildren, changeTextStyleInChildren, childrenCreated, className, clipParameters, color, createAccessibilityImplementation, createChildAtDepth, createEvent, ction, dispatchEvent, embedFonts, findNextAvailableDepth, fontFamily, fontSize, fontStyle, fontWeight, handleEvent, idNames, ignoreClassStyleDeclaration, initProperties, marginLeft, marginRight, methodTable, notifyStyleChangeInChildren, removeEventListener, setStyle, stylecache, styleName, symbolName, symbolOwner, textAlign, textColorList, textDecoration, textIndent, validateNow, version

Fields inherited from class MovieClip

_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, useHandCursor

Fields inherited from class Object

__proto__, constructor, prototype

Property Summary

public
activePlayControl: String (read, write)
The active play control must be either play or pause.

public
backgroundStyle: String (read, write)
Should the component draw chrome?

public
controllerPolicy: String (read, write)
Indicates how the controller behaves wrt mouse interaction.

public
enabled: Boolean (read, write)
Enable or disable this component

public
expanded: Boolean (read-only)


public
horizontal: Boolean (read, write)


public
lastProgressMediaType: String (read-only)


public
playing: Boolean (read, write)


public
playPercent: Number (read, write)


public
playTime: Number (read, write)


public
volume: Number (read, write)
Set the volume that is displayed in the controller.

Properties inherited from class mx.core.UIComponent

height, width

Properties inherited from class mx.core.UIObject

bottom, height, left, minHeight, minWidth, right, scaleX, scaleY, top, visible, width, x, y

Constructor

public
MediaController ( )
Constructor

Method Summary

public
addSecondChrome ( theChrome: Chrome, closedHeight: Number, openHeight: Number, closedWidth: Number, openWidth: Number, fixedEnd: Boolean ): Void
Add a second chrome to the control.

public
associateDisplay ( d: MediaDisplay ): Void
Associated this controller with a display.

public
broadcastEvent ( eventType: String, detailArg ): Void
Broadcast an event.

public
contract ( force: Boolean ): Void
If policy is auto for this clip, contract it.


draw ( Void ): Void


public
evaluateToEnd ( ): Void
Enable or disable the toEnd button, as appropriate.

public
expand ( force: Boolean ): Void
If policy is auto for this clip, expand the controller.

public
getLoadBar ( ): LoadBar


public
getLoadPercent ( ): Number
This function is only for the internal use of the the controller.

public
getLocalizedString ( id: String ): String


public
getMinimumClosedHeight ( ): Number


public
getMinimumClosedWidth ( ): Number


public
getMinimumOpenHeight ( ): Number


public
getMinimumOpenWidth ( ): Number


public
handleEvent ( ev: Object ): Void
Handle events for which the controller listens


init ( Void ): Void
Initialize the controller.

public
isListeningForPlayheadMoveEvent ( ): Boolean


public
isNotAnimating ( ): Boolean


public
isOpenUpOrLeft ( ): Boolean


public
isPlaying ( ): Boolean


public
isScrubbing ( ): Boolean
Is the user scrubbing the media?

public
onMouseMove ( ): Void
Manually monitor mouse movement.

public
refreshBars ( ): Void


public
removeSecondChrome ( ): Void
Remove the second chrome instance from the controller.

public
setListeningForPlayheadMoveEvent ( listen: Boolean ): Void


public
setNotAnimating ( still: Boolean ): Void


public
setOpenUpOrLeft ( is: Boolean ): Void


public
setPlaying ( playFlag: Boolean ): Void


public
setSize ( w: Number, h: Number, noEvent: Boolean ): Void
size the object

Methods inherited from class mx.core.UIComponent

dispatchValueChangedEvent, enabledChanged, findFocusFromObject, findFocusInChildren, getFocus, getFocusManager, init, isParent, onKillFocus, onSetFocus, pressFocus, releaseFocus, setEnabled, setFocus, setVisible, size

Methods inherited from class mx.core.UIObject

__getTextFormat, _createChildren, _getTextFormat, cancelAllDoLaters, constructObject, createChildren, createClassObject, createEmptyObject, createLabel, createObject, createSkin, destroyObject, doLater, doLaterDispatcher, draw, drawRect, getClassStyleDeclaration, getMinHeight, getMinWidth, getSkinIDName, getStyle, getStyleName, init, initFromClipParameters, invalidate, invalidateStyle, mergeClipParameters, move, redraw, setColor, setMinHeight, setMinWidth, setSize, setSkin, setVisible, size

Methods inherited from class MovieClip

attachAudio, attachMovie, beginFill, beginGradientFill, clear, createEmptyMovieClip, createTextField, curveTo, duplicateMovieClip, endFill, getBounds, getBytesLoaded, getBytesTotal, getDepth, getInstanceAtDepth, getNextHighestDepth, getSWFVersion, getTextSnapshot, getURL, globalToLocal, gotoAndPlay, gotoAndStop, hitTest, lineStyle, lineTo, loadMovie, loadVariables, localToGlobal, moveTo, nextFrame, onData, onDragOut, onDragOver, onEnterFrame, onKeyDown, onKeyUp, onKillFocus, onLoad, onMouseDown, onMouseMove, onMouseUp, onPress, onRelease, onReleaseOutside, onRollOut, onRollOver, onSetFocus, onUnload, play, prevFrame, removeMovieClip, setMask, startDrag, stop, stopDrag, swapDepths, unloadMovie, valueOf

Methods inherited from class Object

addProperty, hasOwnProperty, isPropertyEnumerable, isPrototypeOf, registerClass, toLocaleString, toString, unwatch, valueOf, watch



Field Documentation

clipParameters

var clipParameters: Object

playAtBeginning

public var playAtBeginning: Boolean
Should a click on the play button start play at the beginning of the media? Must be public because the PlayPauseButton class needs to update it.

symbolName

static var symbolName: String
This set of properties is for FUIComponent

symbolOwner

static var symbolOwner: Object

version

static var version: String
Copyright (C) 2003 Macromedia, Inc.

All Rights Reserved. The following is Sample Code and is subject to all restrictions on such code as contained in the End User License Agreement accompanying this product.


Property Documentation

activePlayControl

public activePlayControl: String (read, write)
The 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.

backgroundStyle

public backgroundStyle: String (read, write)
Should the component draw chrome?

controllerPolicy

public controllerPolicy: String (read, write)
Indicates 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.

enabled

public enabled: Boolean (read, write)
Enable or disable this component

expanded

public expanded: Boolean (read-only)

horizontal

public horizontal: Boolean (read, write)

lastProgressMediaType

public lastProgressMediaType: String (read-only)

playing

public playing: Boolean (read, write)
Value:
True if the control is playing; false if not.

playPercent

public playPercent: Number (read, write)

playTime

public playTime: Number (read, write)

volume

public volume: Number (read, write)
Set the volume that is displayed in the controller.

Value:
The most recent volume setting


Constructor Documentation

MediaController

public function MediaController()
Constructor


Method Documentation

addSecondChrome

public function addSecondChrome(theChrome: Chrome,
 closedHeight: Number,
 openHeight: Number,
 closedWidth: Number,
 openWidth: Number,
 fixedEnd: Boolean): Void
Add a second chrome to the control.

This is used to allow the controller to animate the chrome of the player in auto mode.

associateDisplay

public function associateDisplay(d: MediaDisplay): Void
Associated this controller with a display.

Set up the event listeners between the two.

broadcastEvent

public function broadcastEvent(eventType: String,
 detailArg): Void
Broadcast an event.

Parameters:
eventType
The type of event (play, stop, pause, etc)
detailArg
An additional parameter for the specific event type

contract

public function contract(force: Boolean): Void
If policy is auto for this clip, contract it.

Otherwise, do nothing. Unless forced.

draw

function draw(Void): Void
Overrides:

evaluateToEnd

public function evaluateToEnd(): Void
Enable or disable the toEnd button, as appropriate.

expand

public function expand(force: Boolean): Void
If policy is auto for this clip, expand the controller.

Otherwise, do nothing. Unless forced.

getLoadBar

public function getLoadBar(): LoadBar

getLoadPercent

public function getLoadPercent(): Number
This function is only for the internal use of the the controller.

It is public so that subclips can access it.

getLocalizedString

public function getLocalizedString(id: String): String
Parameters:
id
The id of the string to retrieve
Returns:
The value of the string

getMinimumClosedHeight

public function getMinimumClosedHeight(): Number

getMinimumClosedWidth

public function getMinimumClosedWidth(): Number

getMinimumOpenHeight

public function getMinimumOpenHeight(): Number

getMinimumOpenWidth

public function getMinimumOpenWidth(): Number

handleEvent

public function handleEvent(ev: Object): Void
Handle events for which the controller listens

Overrides:

init

function init(Void): Void
Initialize the controller.

Overrides:

isListeningForPlayheadMoveEvent

public function isListeningForPlayheadMoveEvent(): Boolean
Returns:
True if the controller is listening for playhead move events. False if not.

isNotAnimating

public function isNotAnimating(): Boolean

isOpenUpOrLeft

public function isOpenUpOrLeft(): Boolean

isPlaying

public function isPlaying(): Boolean

isScrubbing

public function isScrubbing(): Boolean
Is the user scrubbing the media?

onMouseMove

public function onMouseMove(): Void
Manually 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.

Overrides:

refreshBars

public function refreshBars(): Void

removeSecondChrome

public function removeSecondChrome(): Void
Remove the second chrome instance from the controller.

setListeningForPlayheadMoveEvent

public function setListeningForPlayheadMoveEvent(listen: Boolean): Void
Returns:
True if the controller is listening for playhead move events. False if not.

setNotAnimating

public function setNotAnimating(still: Boolean): Void

setOpenUpOrLeft

public function setOpenUpOrLeft(is: Boolean): Void

setPlaying

public function setPlaying(playFlag: Boolean): Void

setSize

public function setSize(w: Number,
 h: Number,
 noEvent: Boolean): Void
size the object

Overrides:

Parameters:
w
width of the object
h
height of the object
noEvent
if true, doesn't broadcast "resize" event

The documentation was generated from the following file:


Copyright © 1997-2005 Macromedia, Inc. All rights reserved. Generated with AS2Doc