Packagelunas.display.bar
Classpublic class SimpleProgressbar
InheritanceSimpleProgressbar Inheritance AbstractProgressbar Inheritance AbstractProgress Inheritance AbstractComponent Inheritance CoreSprite Inheritance flash.display.Sprite

The SimpleProgressbar component.

Example :

     import flash.display.StageScaleMode ;
     
     import pegas.draw.Align ;
     import pegas.draw.FillStyle ;
     import pegas.draw.LineStyle ;
     
     import lunas.core.Direction ;
     import lunas.core.EdgeMetrics ;
     import lunas.display.bar.SimpleProgressbar ;
     import lunas.events.ComponentEvent ;
     
     stage.scaleMode = StageScaleMode.NO_SCALE ;
     
     var change:Function = function( e:ComponentEvent ):void
     {
         trace( e.type + " : " + bar.position ) ;
     }
     
     var bar:SimpleProgressbar = new SimpleProgressbar() ;
     bar.addEventListener( ComponentEvent.CHANGE , change ) ;
     bar.x = 50 ;
     bar.y = 50 ;
     bar.position = 50 ;
     
     addChild(bar) ;
     
     var keyDown:Function = function( e:KeyboardEvent ):void
     {
         var code:uint = e.keyCode ;
         switch( code )
         {
             case Keyboard.LEFT :
             {
                 bar.position -= 10 ;
                 break ;
             }
             case Keyboard.RIGHT :
             {
                 bar.position += 10 ;
                 break ;
             }
             case Keyboard.SPACE :
             {
                 bar.lock() ;
                 bar.align               = Align.CENTER ; // Align.LEFT or Align.RIGHT or Align.CENTER
                 bar.direction           = Direction.HORIZONTAL ;
                 bar.backgroundFillStyle = new FillStyle( 0xB5C7CA , 1 ) ;
                 bar.backgroundLineStyle = new LineStyle( 2 , 0xFFFFFF , 1 ) ;
                 bar.barFillStyle        = new FillStyle( 0x921085 , 1 ) ;
                 bar.barLineStyle        = new LineStyle( 1 , 0x6A9195, 1 ) ;
                 bar.border              = new EdgeMetrics(2, 2, 2, 2) ;
                 bar.unlock() ;
                 bar.setSize( 200, 8 ) ;
                 break ;
             }
             case Keyboard.UP :
             {
                 bar.minimum = 20  ;
                 bar.maximum = 200 ;
                 break ;
             }
             default :
             {
                 bar.direction = ( bar.direction == Direction.VERTICAL ) ? Direction.HORIZONTAL : Direction.VERTICAL ;
                 if ( bar.direction == Direction.VERTICAL )
                 {
                     bar.setSize( 8, 200 ) ;
                 }
                 else
                 {
                     bar.setSize( 200, 8 ) ;
                 }
             }
         }
     }
     
     stage.addEventListener( KeyboardEvent.KEY_DOWN , keyDown ) ;
     
     trace("Press Keyboard.LEFT or Keyboard.RIGHT or Keyboard.SPACE or other keyboard touch to test this example.") ;
     



Public Properties
 PropertyDefined by
  align : uint
(read-write) Indicates the align value of the bar.
SimpleProgressbar
 InheritedautoResetPosition : Boolean = false
This flag indicates of the position is auto reset.
AbstractProgress
  background : Shape
The background reference of this component.
SimpleProgressbar
  backgroundFillStyle : IFillStyle
Determinates the fill style object of the background.
SimpleProgressbar
  backgroundLineStyle : ILineStyle
Determinates the line style object of the background.
SimpleProgressbar
  bar : Shape
The thumb reference of this bar.
SimpleProgressbar
  barFillStyle : IFillStyle
Determinates the fill style object of the bar.
SimpleProgressbar
  barLineStyle : ILineStyle
Determinates the line style object of the bar.
SimpleProgressbar
 Inheritedborder : EdgeMetrics
Indicates the thickness, in pixels, of the four edge regions around a visual component.
AbstractComponent
 Inheritedbubbles : Boolean = true
Indicates if the events use bubbling when are dispatched.
AbstractComponent
 Inheritedbuilder : IBuilder
Indicates the IBuilder reference of this instance.
AbstractComponent
 InheritedcomponentInspectorSetting : Boolean
Initialize when the Flash component settings are initialized (only in Flash with a compiled component).
AbstractComponent
 Inheriteddirection : String
Indicates the direction value of this object (default value is Direction.HORIZONTAL).
AbstractProgressbar
 Inheritedenabled : Boolean
Indicates the enabled state of the component.
AbstractComponent
 Inheritedgroup : Boolean
Indicates with a boolean if this object is grouped.
AbstractComponent
 InheritedgroupName : String
Indicates the name of the group of this object.
AbstractComponent
 Inheritedh : Number
(read-only) Indicates the virtual height value of this component.
AbstractComponent
 Inheritedid : *
Returns the id of this object.
CoreSprite
 InheritedisConfigurable : Boolean
Indicates if the display is configurable.
CoreSprite
 InheritedmaxHeight : Number
This property defined the maximum height of this component.
AbstractComponent
 Inheritedmaximum : Number
(Read-write) The maximum value of this scrollbar.
AbstractProgress
 InheritedmaxWidth : Number
This property defined the maximum width of this component.
AbstractComponent
 InheritedminHeight : Number
This property defined the mimimun height of this component.
AbstractComponent
 Inheritedminimum : Number
(Read-write) The minimum value of this scrollbar.
AbstractProgress
 InheritedminWidth : Number
This property defined the mimimun width of this component.
AbstractComponent
 Inheritedposition : Number
Indicates the position of the progress bar.
AbstractProgress
 Inheritedstyle : IStyle
Returns the style of this component.
AbstractComponent
 Inheritedw : Number
(read-only) Indicates the virtual width value of this component.
AbstractComponent
Protected Properties
 PropertyDefined by
 Inherited_h : Number = 0
The protected virtual height value of the component.
AbstractComponent
 Inherited_max : Number = 100
The max value of the progress.
AbstractProgress
 Inherited_min : Number = 0
The min value of the progress.
AbstractProgress
 Inherited_position : Number = 0
The position value of the bar.
AbstractProgress
  scrollArea : Rectangle
The bar area Rectangle value object.
SimpleProgressbar
 Inherited_w : Number = 0
The protected virtual width value of the component.
AbstractComponent
Public Methods
 MethodDefined by
  
SimpleProgressbar(direction:String = null, id:Boolean = null, isConfigurable:String = "false", name:* = null)
Creates a new SimpleProgressbar instance.
SimpleProgressbar
 Inherited
doLater():void
Launch an event with a delayed interval.
AbstractComponent
  
draw(... arguments):void
Draws the view of the component.
SimpleProgressbar
 Inherited
Returns the IBuilder constructor use to initialize this component.
AbstractComponent
 Inherited
Returns the internal ILogger reference of this ILogable object.
CoreSprite
 Inherited
Returns the IStyle constructor use to initialize this component.
AbstractComponent
 Inherited
Invoked when the group property or the groupName property changed.
AbstractComponent
 Inherited
hashCode():uint
Returns a hashcode value for the object.
CoreSprite
 Inherited
hide():void
Hides the component.
AbstractComponent
 Inherited
initialize():void
Initialize the component.
AbstractComponent
 Inherited
isLocked():Boolean
Returns true if the object is locked.
CoreSprite
 Inherited
isVisible():Boolean
Returns true if the component is visible.
AbstractComponent
 Inherited
lock():void
Locks the object.
CoreSprite
 Inherited
move(x:Number, y:Number):void
Moves the component.
AbstractComponent
 Inherited
Notify a change in this component.
AbstractComponent
 Inherited
Notify an event when the enabled property is changed.
AbstractComponent
 Inherited
Notify an event when you resize the component.
AbstractComponent
 Inherited
refresh(init:*):void
Refresh the component with an object of initialization.
AbstractComponent
 Inherited
resetLock():void
Reset the lock security of the display.
CoreSprite
  
resize():void
Resize the bar.
SimpleProgressbar
 Inherited
setLogger(log:ILogger = null):void
Sets the internal ILogger reference of this ILogable object.
CoreSprite
 Inherited
setPosition(value:Number, noEvent:Boolean = false, flag:Boolean = false):void
Sets the position of the progress bar.
AbstractProgress
 Inherited
setSize(w:Number, h:Number):void
Sets the virtuals width and height of the component.
AbstractComponent
 Inherited
setStyle(... args):void
Sets the style property on the style declaration or object.
AbstractComponent
 Inherited
setup():void
Setup the IConfigurable object.
CoreSprite
 Inherited
show():void
Shows the component.
AbstractComponent
 Inherited
toString():String
Returns the String representation of this object.
CoreSprite
 Inherited
unlock():void
Unlocks the display.
CoreSprite
 Inherited
update():void
Updates the component.
AbstractComponent
 Inherited
viewChanged():void
Invoked when the view of the display is changed.
AbstractProgress
 Inherited
viewDestroyed(e:Event = null):void
Invoked when the component is destroyed with a removeMovieClip.
AbstractComponent
 Inherited
viewEnabled():void
Invoked when the enabled property of the component change.
AbstractComponent
  
viewPositionChanged(flag:Boolean = false):void
Invoked when the position of the bar is changed.
SimpleProgressbar
 Inherited
viewResize():void
Invoked when the component is resized.
AbstractComponent
 Inherited
viewStyleChanged(e:Event = null):void
Invoked when the component IStyle changed.
AbstractComponent
Protected Methods
 MethodDefined by
 Inherited
addedToStage(e:Event = null):void
Invoked when the display is added to the stage.
CoreSprite
 Inherited
fireComponentEvent(type:String):void
Dispatchs a ComponentEvent with the specified type.
AbstractComponent
 Inherited
removedFromStage(e:Event = null):void
Invoked when the display is removed from the stage.
CoreSprite
Property detail
alignproperty
align:uint  [read-write]

(read-write) Indicates the align value of the bar. This property can take the 3 values Align.LEFT, Align.CENTER, Align.RIGHT. The default value of the align property is Align.LEFT ;

Implementation
    public function get align():uint
    public function set align(value:uint):void

See also

Align
backgroundproperty 
public var background:Shape

The background reference of this component.

backgroundFillStyleproperty 
backgroundFillStyle:IFillStyle  [read-write]

Determinates the fill style object of the background.

Implementation
    public function get backgroundFillStyle():IFillStyle
    public function set backgroundFillStyle(value:IFillStyle):void
backgroundLineStyleproperty 
backgroundLineStyle:ILineStyle  [read-write]

Determinates the line style object of the background.

Implementation
    public function get backgroundLineStyle():ILineStyle
    public function set backgroundLineStyle(value:ILineStyle):void
barproperty 
public var bar:Shape

The thumb reference of this bar.

barFillStyleproperty 
barFillStyle:IFillStyle  [read-write]

Determinates the fill style object of the bar.

Implementation
    public function get barFillStyle():IFillStyle
    public function set barFillStyle(value:IFillStyle):void
barLineStyleproperty 
barLineStyle:ILineStyle  [read-write]

Determinates the line style object of the bar.

Implementation
    public function get barLineStyle():ILineStyle
    public function set barLineStyle(value:ILineStyle):void
scrollAreaproperty 
protected var scrollArea:Rectangle

The bar area Rectangle value object.

Constructor detail
SimpleProgressbar()constructor
public function SimpleProgressbar(direction:String = null, id:Boolean = null, isConfigurable:String = "false", name:* = null)

Creates a new SimpleProgressbar instance.

Parameters
direction:String (default = null) — The direction value of the bar (see Direction).
 
id:Boolean (default = null) — Indicates the id of the object.
 
isConfigurable:String (default = "false") — This flag indicates if the IConfigurable object is register in the ConfigCollector.
 
name:* (default = null) — Indicates the instance name of the object.
Method detail
draw()method
public override function draw(... arguments):void

Draws the view of the component.

Parameters
... arguments
resize()method 
public function resize():void

Resize the bar.

viewPositionChanged()method 
public override function viewPositionChanged(flag:Boolean = false):void

Invoked when the position of the bar is changed.

Parameters
flag:Boolean (default = false) — (optional) An optional boolean. By default this flag is passed-in the setPosition method.