PlayBar

Kind of class:class
Inherits from:MovieClip
Author:Andrew Guldman
Classpath:mx.controls.streamingmedia.PlayBar
File last modified:Tuesday, 18 December 2007, 15:44:38
The load bar that indicates how much of the streaming media has
been loaded.

Summary


Constructor
Class properties
Instance properties
Instance methods

Constructor

PlayBar

function PlayBar (
)

Constructor.

Class properties

ACTIVE_PULSE_PORTION

static private ACTIVE_PULSE_PORTION:Number = .4
(read)

The portion of the pulse where active transition occurs

PAUSED_ID

static private PAUSED_ID:String = "paused"
(read)

PULSE_DURATION

static private PULSE_DURATION:Number = 1400
(read)

The length of each pulse in ms

STREAMING_ID

static private STREAMING_ID:String = "streaming"
(read)

Id's of localized strings

TEXT_ALPHA_DARK

static private TEXT_ALPHA_DARK:Number = 100
(read)

TEXT_ALPHA_LIGHT

static private TEXT_ALPHA_LIGHT:Number = 50
(read)

Instance properties

_controller

private _controller:MediaController
(read)

The controller with which this load bar is associated

_darkenText

private _darkenText:Boolean
(read)

Make the text darker

_hilite

private _hilite:MovieClip
(read)

_statusTextField

private _statusTextField:TextField
(read)

_textPulseTime

private _textPulseTime:Number
(read)

Time that the text color started this pulse

_thumb

private _thumb:PlayBarThumb
(read)

The draggable thumb

_timeTextField

private _timeTextField:TextField
(read)

_tray

private _tray
(read)

The type of the tray will change (HPlayBarTray or VPlayBarTray)
depending on orientation. Leave the member untyped.

enabled

enabled:Boolean
(read,write)

Instance methods

draw

function draw (
) : Void

Draw the play bar.

getCompletionPercentage

function getCompletionPercentage (
) : Number

Set the completion percentage.

getController

function getController (

Returns:
  • The controller associated with the play bar.

getHeight

function getHeight (
) : Number

Returns:
  • The height of the play bar

getWidth

function getWidth (
) : Number

Returns:
  • The width of the play bar

init

private function init (
) : Void

Initialize the component.

isScrubbing

function isScrubbing (
) : Boolean

Is the thumb being dragged?

isVertical

function isVertical (
) : Boolean

percentToX

function percentToX (
percent:Number) : Number

Parameters:
percent:
The percent complete. Between 0 and 100.
Returns:
  • The x coordinate of the thumb. Between -3 and (width - 6).

percentToY

function percentToY (
percent:Number) : Number

Parameters:
percent:
The percent complete. Between 0 and 100.
Returns:
  • The y coordinate of the thumb. Between -3 and (height - 6).

pulseText

private function pulseText (
) : Void

Gently pulse the text fields

setCompletionPercentage

function setCompletionPercentage (
aPercentage:Number) : Void

Set the completion percentage.

setDarkText

private function setDarkText (
) : Void

Make the text fields dark

setIsPlaying

function setIsPlaying (
isPlaying:Boolean) : Void

Let the playBar know if it is playing. Update the status text.

setLightText

private function setLightText (
) : Void

Make the text fields light

setTime

function setTime (
aTime:Number) : Void

Set the current time in seconds

updateHiliteToMatchThumb

function updateHiliteToMatchThumb (
) : Void

xToPercent

function xToPercent (
x:Number) : Number

Parameters:
x:
The x coordinate of the thumb. Between -3 and (width - 6).
Returns:
  • The percent complete. Between 0 and 100.

yToPercent

function yToPercent (
y:Number) : Number

Parameters:
y:
The y coordinate of the thumb. Between -3 and (height - 6).
Returns:
  • The percent complete. Between 0 and 100.