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

Parameters None
Returns Nothing
Example
    None


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

Parameters pOwner The movie clip on which the new ToggleButton will be drawn.
strName The new ToggleButton instance name.
nDepth The new ToggleButton instance depth.
Returns The reference to new ToggleButton instance
Example
    var btn = pseudo.ToggleButton.create(this, "btn", 1);
    btn.setSize(100, 20);
    
    //Apply the skin to the button
    
    btn.setLook(pseudo.look.XPLook.getInstance());
    
    //Here we add a label to the button, what is a little bit tricky
    
    var lbl:pseudo.Label = pseudo.Label(btn.addItem(pseudo.Label));
    lbl.setAlign("center");
    lbl.setText("XP Button");
    
    //Calling these functions will finally draw the component
    
    btn.update();
    btn.draw();
    
    // similar the the code above we create a check box,
    // with the only difference, you should call the
    // method setData for this instance of the button and
    // pass an instance of the Object having the flag "type" set to "checkbox"
    
    var btnCheckBox = pseudo.ToggleButton.create(this, "btnCheckBox", 8);
    btnCheckBox.setLook(pseudo.look.XPLook.getInstance());
    btnCheckBox.setSize(100, 20);
    
    var lbl1:pseudo.Label = pseudo.Label(btnCheckBox.addItem(pseudo.Label));
    lbl1.setText("Check Box");
    
    //call the method setData for this instance of the button
    // and pass an instance of the Object having the flag "type" set to "checkbox"
    
    btnCheckBox.setData({type:"checkbox"});
    
    btnCheckBox._y = btn._y +100;
    
    btnCheckBox.update();
    btnCheckBox.draw();
    
    // This code will draw the buttons 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.ToggleButton.setState(state:String):Void
Use this function set the ToggleButton instance state either "normal" or "sunken.

Parameters state String indicating what state should be applied to the button. There are two possible states for this button "normal" and "sunken"
Returns Nothing
Example
    None
Flash UI Components (c)TUFaT.com, All Rights Reserved.