LoadBar

Kind of class:class
Inherits from:MovieClip
Author:Andrew Guldman
Classpath:mx.controls.streamingmedia.LoadBar
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
Instance properties
Instance methods

Constructor

LoadBar

function LoadBar (
)

Instance properties

_background

private _background:MovieClip
(read)

_border

private _border:MovieClip
(read)

_controller

private _controller:MediaController
(read)

The controller with which this load bar is associated

_fill

private _fill:MovieClip
(read)

Instance methods

draw

function draw (
size:Number) : Void

Draw the load bar.
Parameters:
size:
The height or width at which to draw the load bar. OPTIONAL.
If omitted, the load bar will be drawn at its standard height or width.

getActualHeight

private function getActualHeight (
) : Number

This "actual" functions are necessary because the bar height animates
when the controller expands and contracts in vertical position.
We need the fill to animate accurately also.

getActualWidth

private function getActualWidth (
) : Number

getClosedHeight

function getClosedHeight (
) : Number

getCompletionPercentage

function getCompletionPercentage (
) : Number

Get the completion percentage.

getHeight

function getHeight (
) : Number

Returns:
  • The height of the load bar

getOpenHeight

function getOpenHeight (
) : Number

getWidth

function getWidth (
) : Number

Returns:
  • The width of the play bar

init

private function init (
) : Void

isVertical

private function isVertical (
) : Boolean

Is the load bar vertical? (vs horizontal)

percentToX

function percentToX (
percent:Number) : Number

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

percentToY

function percentToY (
percent:Number) : Number

Parameters:
percent:
The percent complete. Between 0 and 100.
Returns:
  • The y coordinate of the fill bar. Between 0 and (height - 2).

setCompletionPercentage

function setCompletionPercentage (
aPercentage:Number) : Void

Set the completion percentage.

xToPercent

function xToPercent (
x:Number) : Number

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

yToPercent

function yToPercent (
y:Number) : Number

Parameters:
y:
The y coordinate of the fill bar. Between 0 and (height - 2).
Returns:
  • The percent complete. Between 0 and 100.