mx.controls
Class ProgressBar



class ProgressBar
extends mx.core.UIObject

The ProgressBar control provides a visual representation of the progress of a task over time. There are two types of ProgressBar control: determinate and indeterminate.

A determinate ProgressBar control is a linear representation of the progress of a task over time. You use a determinate ProgressBar when the scope of the task is known. It displays when the user has to wait for an extended amount of time.

An indeterminate ProgressBar control represents time-based processes for which the scope is not yet known. As soon as you can determine the scope, you should use a determinate ProgressBar control.

MXML Syntax

The <mx:ProgressBar> tag inherits all the properties of its parent classes, and the following properties:

 <mx:ProgressBar
conversion=""
direction=="right|left"
indeterminate="false|true"
label="No default."
labelPlacement="bottom|top|left|right|center"
maximum="0"
minimum="0"
mode="event|polled|manual"
source="No default."
complete="Event handler; no default."
progress="Event handler; no default."
/>



Constructors
ProgressBar ()
Constructor.


Methods
      setProgress(completed:Number, total:Number) : Void
Sets the state of the bar to reflect the amount of progress made when using manual mode.

Methods inherited from class mx.core.UIObject
createAccessibilityImplementation  measure  doLater  cancelAllDoLaters  invalidate  invalidateStyle  invalidateProperties  invalidateSize  redraw  move  setSize  setSizeNoLayout  drawRect  fillRect  destroyLabel  createClassObject  createEmptyObject  destroyObject  getStyle  setMask  swapDepths 


Properties
      className:String  
Name of this class.
staticversion:String  
ComponentVersion is for internal use only.
      mode:String   [Read-Write]
Mode, which can be event, polled, or manual.
      source:Object   [Read-Write]
Instance that loads content to the progress bar.
      direction:String   [Read-Write]
Direction of fill of the progress bar.
      label:String   [Read-Write]
Text that accompanies the progress bar.
      labelPlacement:String   [Read-Write]
Placement of label.
      indeterminate:Boolean   [Read-Write]
Whether the Progress Bar control has a determinate or indeterminate appearance.
      conversion:Number   [Read-Write]
Number used to convert incoming current bytes loaded value and the total bytes loaded values.
      percentComplete:Number   [Read-Only]
Percentage of process that is completed.
      maximum:Number   [Read-Write]
Largest progress value for the progress bar.
      minimum:Number   [Read-Write]
Smallest progress value for the progress bar.
      value:Number   [Read-Only]
Read-only property that contains the amount of progress that has been made - between the minimum and maximum values.

Properties inherited from class mx.core.UIObject
version  nestLevel  dispatchEvent  addEventListener  handleEvent  removeEventListener  kStretch  styleName  className  setStyle  parentApplication  isDocument  parentDocument  documentDescriptor  descriptor  instanceIndices  repeaterIndices  getRepeaterItem  id  width  height  x  y  minHeight  minWidth  preferredHeight  preferredWidth  maxHeight  maxWidth  widthFlex  heightFlex  visible  scaleX  scaleY  alpha  depth  mouseX  mouseY  toolTip  baselinePosition 


Effects

Effects inherited from class mx.core.UIObject
creationCompleteEffect  moveEffect  resizeEffect  mouseDownEffect  mouseOverEffect  mouseOutEffect  mouseUpEffect 


Events
completeHandler for complete events, which are broadcast when the load completes. The event object contains the following properties:
- current Amount of content currently loaded. - total Total amount of content. Target contains a reference to the component that triggered the event. Type contains the name of the event.
progressHandler for progress events, which are broadcast as content loads in event or polled mode. The target property of the event or polled mode. The event object contains the following properties:
- current Amount of content currently loaded. - total Total amount of content. Target contains a reference to the component that triggered the event. Type contains the name of the event.

Events inherited from class: mx.core.UIObject
initialize  creationComplete  resize  move  draw  load  unload  mouseDown  mouseUp  mouseMove  mouseOver  mouseOut  mouseDownSomewhere  mouseUpSomewhere  mouseMoveSomewhere  mouseChangeSomewhere  effectStart  effectEnd  dragBegin  dragComplete  dragEnter  dragOver  dragExit  dragDrop 


Styles
themeColor Type: Number   Format: Color   CSS Inheritance: yes
Background color of the ProgressBar control. Possible values are haloGreen, haloBlue, and haloOrange. Macromedia recommends setting the themeColor style in the <mx:Application> tag, instead of in individual controls.

Styles inherited from class mx.core.UIObject
color  fontFamily  fontSize  fontStyle  fontWeight  textAlign  textDecoration  textIndent  marginLeft  marginRight  horizontalGap  verticalGap 


Constructor Detail

ProgressBar

ProgressBar()

Constructor.


Method Detail

setProgress

setProgress(completed:Number, total:Number) : Void

Sets the state of the bar to reflect the amount of progress made when using manual mode. The argument completed is assigned to value property and argument total is assigned to the maximum property. The minimum property is not altered.

Parameters
     completed - Current value.
     total - Total value.


Property Detail

className

className:String  

Name of this class.


conversion

conversion:Number   [Read-Write]

Number used to convert incoming current bytes loaded value and the total bytes loaded values. Flex divides the current and total values and floors them before displaying in the label string. The floor is the closest integer that is less than or equal to the specified value. The default value is 1, which does no conversion.


direction

direction:String   [Read-Write]

Direction of fill of the progress bar. Valid values are right and left. The default value is right.


indeterminate

indeterminate:Boolean   [Read-Write]

Whether the Progress Bar control has a determinate or indeterminate appearance. If true, the appearance is indeterminate. The default value is false.


label

label:String   [Read-Write]

Text that accompanies the progress bar. You can include the following special characters in the text string: %1 = current loaded bytes, %2 = total bytes, %3 = percent loaded, %% = `%` character. If a field is unknown, it is replaced by `??`. If undefined, the label is not displayed.


labelPlacement

labelPlacement:String   [Read-Write]

Placement of label. Possible values are top, bottom, left, right, and center. The default is bottom.


maximum

maximum:Number   [Read-Write]

Largest progress value for the progress bar. You can only use this property in manual mode. The default value is 0.


minimum

minimum:Number   [Read-Write]

Smallest progress value for the progress bar. This property is set by the developer only in manual mode. The default value is 0.


mode

mode:String   [Read-Write]

Mode, which can be event, polled, or manual. The default is event.


percentComplete

percentComplete:Number   [Read-Only]

Percentage of process that is completed. This property is read-only: use the setProgress method to change.


source

source:Object   [Read-Write]

Instance that loads content to the progress bar. Use this property only in event and polled mode.


value

value:Number   [Read-Only]

Read-only property that contains the amount of progress that has been made - between the minimum and maximum values.


version

static version:String  

ComponentVersion is for internal use only.