Main Page | Packages | Class Tree | Index | Help

com.bjc.controls

class ProgressBar

MovieClip
  |
  +--com.bjc.core.BJCComponent
        |
        +--com.bjc.core.LabelWrapper
              |
              +--com.bjc.controls.ProgressBar


class ProgressBar
extends LabelWrapper

Displays the progress of any changing value, such as percent loaded, or amount of a song played.


Author:
Flashloaded - www.flashloaded.com


Fields inherited from class com.bjc.core.BJCComponent

version

Property Summary

public
autoHide: Boolean (write)
Sets the autohide mode of the component. If set to true, the progress bar will become invisible when the value has reached the maximum.

public
autoHide: Boolean (read)
Gets the autohide mode of the component.

public
digits: Number (write)
Determines how many digits of accuracy to display in the display label. i.e. a value of two will show 99.99 %, one will show 99.9 %, zero will show 99 %.

public
digits: Number (read)
Gets the amount of accuracy digits displayed in the label.

public
displayLabel: Boolean (write)
Sets the visibility of the component label. If true, a label will appear below the bar, showing percent loaded, value, or value / maximum.

public
displayLabel: Boolean (read)
Gets the visibility of the component label.

public
displayType: String (write)
Determines what type of data will be displayed in the label. "percent" will display the percentage of the value to maximum. "value" simply displays the value. "valueTotal displays value and total, separated by "/".

public
displayType: String (read)
Gets the data type displayed in the label.

public
maximum: Number (write)
Sets the maximum value that the progress bar can achieve. This would often be 100 for diplaying a percentage value, or could be MovieClip.getBytesTotal(), or Sound.duration.

public
maximum: Number (read)
Gets the maximum value that the progress bar can achieve.

public
suffix: String (write)
A string added on to the end of the numbers displayed in the label. Used to show what the units specify.

public
suffix: String (read)
Gets the string added on to the end of the numbers displayed in the label.

public
value: Number (write)
Sets the progress displayed by the bar. For example, if maximum is 100 and value is 50, the progress bar will show 1/2 way done.

public
value: Number (read)
Gets the progress displayed by the bar.

Properties inherited from class com.bjc.core.LabelWrapper

align, disabledColor, disableStyles, embedFont, fontColor, fontFace, fontSize, html

Properties inherited from class com.bjc.core.BJCComponent

disabledAlpha, enabled, focusTime, height, keyEnabled, style, width

Constructor

public
ProgressBar ( Void)


Method Summary

public static
create ( target: MovieClip, id: String, depth: Number, initObj: Object ): ProgressBar
Static method used to create an instance of a ProgressBar on stage at run time.

Methods inherited from class com.bjc.core.BJCComponent

draw, invalidate, move, remove, setSize



Property Documentation

autoHide

public autoHide: Boolean (write)
Sets the autohide mode of the component. If set to true, the progress bar will become invisible when the value has reached the maximum.

Example:
myProgressBar.autoHide = true;

autoHide

public autoHide: Boolean (read)
Gets the autohide mode of the component.

Example:
myVar = myProgressBar.autoHide;

digits

public digits: Number (write)
Determines how many digits of accuracy to display in the display label. i.e. a value of two will show 99.99 %, one will show 99.9 %, zero will show 99 %.

Example:
myProgressBar.digits = 2;

digits

public digits: Number (read)
Gets the amount of accuracy digits displayed in the label.

Example:
myVar = myProgressBar.digits;

displayLabel

public displayLabel: Boolean (write)
Sets the visibility of the component label. If true, a label will appear below the bar, showing percent loaded, value, or value / maximum.

Example:
myProgressbar.displayLabel = true;

displayLabel

public displayLabel: Boolean (read)
Gets the visibility of the component label.

Example:
myVar = myProgressbar.displayLabel;

displayType

public displayType: String (write)
Determines what type of data will be displayed in the label. "percent" will display the percentage of the value to maximum. "value" simply displays the value. "valueTotal displays value and total, separated by "/".

Example:
myProgressBar.displayLabel = true;
myProgressBar.displaytype = "valueTotal";
myProgressBar.suffix = "seconds";
// will display something like: "34 / 45 seconds"

displayType

public displayType: String (read)
Gets the data type displayed in the label.

Example:
myVar = myProgressBar.displaytype;

maximum

public maximum: Number (write)
Sets the maximum value that the progress bar can achieve. This would often be 100 for diplaying a percentage value, or could be MovieClip.getBytesTotal(), or Sound.duration.

Example:
myProgressBar.maximum = mySound.duration;

maximum

public maximum: Number (read)
Gets the maximum value that the progress bar can achieve.

Example:
myVar = myProgressBar.maximum;

suffix

public suffix: String (write)
A string added on to the end of the numbers displayed in the label. Used to show what the units specify.

Example:
myProgressBar.suffix = "bytes";

suffix

public suffix: String (read)
Gets the string added on to the end of the numbers displayed in the label.

Example:
myVar = myProgressBar.suffix;

value

public value: Number (write)
Sets the progress displayed by the bar. For example, if maximum is 100 and value is 50, the progress bar will show 1/2 way done.

Example:
myProgressBar.value = myClip.getBytesLoaded();

value

public value: Number (read)
Gets the progress displayed by the bar.

Example:
myVar = myProgressBar.value;


Constructor Documentation

ProgressBar

public function ProgressBar(Void)

Method Documentation

create

public static function create(target: MovieClip,
 id: String,
 depth: Number,
 initObj: Object): ProgressBar
Static method used to create an instance of a ProgressBar on stage at run time.

Parameters:
target
the movie clip to which the progress bar will be attached.
id
the instance name given to the new progress bar attached.
depth
the depth at which to attach the new progress bar.
initObj
(optional) an object containing any properties you want to assign to the component when it is created
Returns:
a reference to the new progress bar attached.

Example:
import com.bjc.controls.ProgressBar;
var newProgressBar:ProgressBar = ProgressBar.create(_root, "myProgressBar", 0);


The documentation was generated from the following file:


Copyright Flashloaded - www.flashloaded.com