pseudo.ProgressBar class
View Sample :: Return to index  
pseudo.ProgressBar.ProgressBar()
ProgressBar constructor. You never use the constructor to create this component.

Parameters None
Returns Nothing
Example
    None


pseudo.ProgressBar.create(pOwner:MovieClip, strName:String, nDepth:Number):pseudo.ProgressBar
Use this static function to create new ProgressBar on the specified movie clip. Never use constructor directly to do it.

Parameters pOwner The movie clip on which the new ProgressBar will be drawn.
strName The new ProgressBar instance name.
nDepth The new ProgressBar instance depth.
Returns The reference to new ProgressBar instance
Example
  
//Get instance of the look and feel
	var look:Object = pseudo.look.AquaLook.getInstance();
//create an instance of the progress bar
	var progress = pseudo.ProgressBar.create(_root, "progress", 3);
//Porsition, initialize and drae progress bar
  progress.setLook(look);
  progress._x = 90;
  progress._y = 10;
  progress.setType(0);
  progress.setRange(-10, 200);
  progress.setPos(progress.getMin());
  progress.setText(" loading #p1%");
  progress.setSize(180, 20);
  progress.setAlign("center");
  progress.update();
  progress.draw();

// set the initial position of the progress bar indicator
  var m_curPos = progress.getMin();
//Set time inervar to be used to imitate the progress	
  var m_timerId = setInterval(this, "onImitateProgress", 130);

//Function imitating the progress (in real life this vcould be
// loading movie clip, or some other process)
  function onImitateProgress():Void
  {
    progress.setPos(++m_curPos);
    progress.update();
    progress.draw();
    if(m_curPos > progress.getMax() - 1) clearInterval(m_timerId);
  }

		   


pseudo.ProgressBar.setBarParams(bar:Object):Void
here you can setup following parameters:
- w - bar width;
- off - offset between bars;
- count - number of bars in 'loop' mode.


Parameters bar Object Object instance that contains values to initialise progress bar.
Returns Nothing
Example
 
  progressBr.setBarParams({w:10, off:2, count:4})


pseudo.ProgressBar.getBarParams():Object
Returns progress bar parameters.
Parameters None
Returns Object value
Example
     
   progressBr.getBarParams()        

pseudo.ProgressBar. setType(type:Number):Void

Sets progressBar type:

  • 0 - solid;
  • 1 - bar;
  • 2 - loop;

Parameters type Number value
Returns Nothing
Example
    
  //sets the solid type of the progress bar     		
  progressBr.setType(0);  



pseudo.ProgressBar.getType():Number
Returns current progressBar type.

Parameters None
Returns Number value indicating current progress bar type
Example
    
  //returns current type of the progress bar   		
  progressBr.getType();

pseudo.ProgressBar.getProgress():pseudo.Pane
Returns progress rectangle. This function is useful if you want to manually setup some parameters of progressBar such as its size or skin.

Parameters None
Returns Number value
Example
     
                

pseudo.ProgressBar.setAlign(align:String):Void
Sets label align ("left", "center", "right").
Parameters align String value indicating the align type
Returns Nothing
Example
    
  progressBr.setAlign("left");

pseudo.ProgressBar.getAlign():String
Returns current progress bar label align. Possible values: "left", "center", "right" .
Parameters None
Returns String value indicating progress bar label align
Example
    
  trace(progressBr.getAlign());//traces the value of the progress bar label align				  
				  

pseudo.ProgressBar.setVAlign(valign:String):Void
Sets progress bar label vertical align ("top", "middle", "bottom").

Parameters valign String value indicating progress bar label vertical align
Returns Nothing
Example
  progressBr.setVAlign("top");

pseudo.ProgressBar.getVAlign():String
Returns current progress bar label vertical align.
Parameters None
Returns String value indicating progress bar label vertical align
Example
    
  trace(progressBr.getVAlign());//traces the value of the progress bar label vartical align				  
				  

pseudo.ProgressBar.setPlace(place:Number):Void
Sets label placement:
  • 0 - inside;
  • 1 - top;
  • 2 - left;
  • 3 - bottom;
  • 4 - right.

Parameters place Number value indicating label position
Returns Nothing
Example
   progressBr.setPlace(0);// places the the text label inside the progress bar

pseudo.ProgressBar.getPlace():Number
Returns current label placement..
Parameters None
Returns String value indicating the label placement of the progress bar
Example
    
  trace(progressBr.getPlace());//traces the value of the progress bar indicating the label placement
				  

pseudo.ProgressBar.setText(text:String):Void

Sets label text. ProgressBar automatically adds <pos>% to the end of the text. Example: pos=20, text="loading " -> result="loading 20%".
Usage:

#p<count> - shows percentage
#v<count> - shows values
<count> - number of digits after the point

Parameters test String vaue
Returns Nothing
Example
  progress.setText(" loading #p1%");

pseudo.ProgressBar.setRange(min:Number, max:Number):Void
Sets progress bar range.
Parameters min Number value indicating minimum value of the progress bar range
max Number value indicating maximum value of the progress bar range
Returns Nothing
Example
  progress.setRange(-10, 200);

pseudo.ProgressBar.getMin():Number
Returns minimum value of progress bar range.
Parameters None
Returns Number value indicating minimum value of the progress bar range
Example
  trace(progress.getMin());//traces the minimum value of the progress bar

pseudo.ProgressBar.getMax():Number
Returns maximum value of progress bar range.
Parameters None
Returns Number value indicating maximum value of the progress bar range
Example
  trace(progress.getMax());//traces the maximum value of the progress bar

pseudo.ProgressBar.setPos(pos:Number):Void
Sets current position of progressbar. The pos fits into current range.
Parameters pos Number value
Returns Nothing
Example
  progress.setPos(progress.getMin()); //sets the position of the progress bar to its minimum values

 

Flash UI Components (c)TUFaT.com, All Rights Reserved.