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.
been loaded.
Summary
Constructor
Class properties
- TEXT_ALPHA_DARK : Number
- TEXT_ALPHA_LIGHT : Number
- PULSE_DURATION : Number
- The length of each pulse in ms
- ACTIVE_PULSE_PORTION : Number
- The portion of the pulse where active transition occurs
- STREAMING_ID : String
- Id's of localized strings
- PAUSED_ID : String
Instance properties
- _controller : MediaController
- The controller with which this load bar is associated
- _thumb : PlayBarThumb
- The draggable thumb
- _hilite : MovieClip
- _tray
- _statusTextField : TextField
- _timeTextField : TextField
- _darkenText : Boolean
- Make the text darker
- _textPulseTime : Number
- Time that the text color started this pulse
- enabled : Boolean
Instance methods
- init : Void
- Initialize the component.
- isVertical : Boolean
- getCompletionPercentage : Number
- Set the completion percentage.
- setCompletionPercentage (aPercentage:Number) : Void
- Set the completion percentage.
- updateHiliteToMatchThumb : Void
- setTime (aTime:Number) : Void
- Set the current time in seconds
- setIsPlaying (isPlaying:Boolean) : Void
- Let the playBar know if it is playing.
- getController : MediaController
- draw : Void
- Draw the play bar.
- getWidth : Number
- getHeight : Number
- xToPercent (x:Number) : Number
- percentToX (percent:Number) : Number
- yToPercent (y:Number) : Number
- percentToY (percent:Number) : Number
- pulseText : Void
- Gently pulse the text fields
- setDarkText : Void
- Make the text fields dark
- setLightText : Void
- Make the text fields light
- isScrubbing : Boolean
- Is the thumb being dragged?
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
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
_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.
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
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.