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

Parameters None
Returns Nothing
Example
    None


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

Parameters pOwner The movie clip on which the new ScrollBar will be drawn.
strName The new ScrollBar instance name.
nDepth The new ScrollBar instance depth.
Returns The reference to new ScrollBar instance
Example
    //create pseudo.ScrollBar instance
    var scroll:pseudo.ScrollBar = pseudo.ScrollBar.create(this, "scroll", 1);
    
    //set scroll movie clip size
    scroll.setSize(15, 100);
    
    //initialize scroll instance with some data
    scroll.setRange(0, 130);
    scroll.setPos(15);
    scroll.setScrollSize(30);
    scroll.setSmallScroll(1);
    
    //add some listener of the "changePos" event
    scroll.addListener("changePos", _root, _root.onChangedScroll);
    
    //Apply the skin to the scroll
    scroll.setLook(pseudo.look.XPLook.getInstance());
    
    //Calling these functions will finally draw the component
    scroll.update();
    scroll.draw();
    
    //Create a label to display changes that happen with the scroll
    
    var lbl:pseudo.Label = pseudo.Label.create(_root, "lbl", 2);
    lbl.setLook(pseudo.look.StdLook.getInstance());
    lbl.setAutoSize(true);
    
    //Set some default text
    lbl.setText("drag scroll");
    lbl.update();
    lbl.draw();
    lbl._x = scroll._x + scroll.getW() + 10;
    
    //Some function to handle the "changePos" event
    
    function onChangedScroll():Void
    {
       lbl.setText(String(scroll.getPos()));
       lbl.update();
       lbl.draw();
    }
    
    // This code will draw the scroll bar using XP look and feel skin.
    // Please notice that you should always use some skin to create the component,
    // this can be done like in this example, and the skin will be complied into the swf file,
    // or you can use another technique and load the skin at a run time.
           


pseudo.ScrollBar.setData(data:Object):Void
Sets data related to this scroll bar.

Parameters data Object type
Returns Nothing
Example
    None


pseudo.ScrollBar.setRange(nMin:Number, nMax:Number):Void
Sets the minimum and maximum value for the scroll bar.

Parameters nMin Number value
nMax Number value
Returns Nothing
Example
    None


pseudo.ScrollBar.setSelectable(bSelect:Boolean):Void
Use this function set the edit field selectable or not. Default value is selectable.

Parameters bSelect Boolean value
Returns Nothing
Example
    None


pseudo.ScrollBar.setSmallScroll(nScroll:Number):Void
Sets the step offset for the scroll when user presses the arrow buttons.

Parameters nScroll Number value indicating the step offset for the scroll when user presses the arrow buttons
Returns Nothing
Example
    None


pseudo.ScrollBar.setBigScroll(nScroll:Number):Void
Sets the step offset for the scroll when user clicks anywhere on the scroll channel.

Parameters nScroll Number value indicating the step offset for the scroll when user clicks anywhere on the scroll channel
Returns Nothing
Example
    None


pseudo.ScrollBar.doScroll(type:String, dir:String):Void
Scrolls the scrollbar using provided parameter values one step forward. Used rarely.

Parameters type String value can ve "small" or "big"
dir String value can be "increase" or "decrease".
Returns Nothing
Example
    None


pseudo.ScrollBar.setPos(nPos:Number):Boolean
Sets the scroll bar position using the number value

Parameters nPos Number
Returns Nothing
Example
    None


pseudo.ScrollBar.getPos():Number
Use this method to get the current position of the scroll bar.

Parameters None
Returns Number value
Example
    None


pseudo.ScrollBar.getMaxPos():Number
Use this function to get the maximum position value of the scroll bar.

Parameters None
Returns Number value
Example
    None


pseudo.ScrollBar.getMinPos():Number
Use this function to get the minimum position value of the scroll bar.

Parameters None
Returns Number value
Example
    None


pseudo.ScrollBar.setScrollSize(nSize:Number):Void
Sets the visible area size of the scroll bar

Parameters nSize Number value indicating the visible area size
Returns Nothing
Example
    None


pseudo.ScrollBar.setAlign(strAlign:String):Void
Use this function to draw horizontal or vertical scroll bar. If the parameters value is "horz" them the scoll bar will be a horizontal one, otherwise it will be vertical. By default a vertical scroll bar is created.

Parameters strAlign String value
Returns Nothing
Example
    None


pseudo.ScrollBar.remove():Void
??????????????????????????????

Parameters None
Returns Nothing
Example
    None
Flash UI Components (c)TUFaT.com, All Rights Reserved.