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

Parameters None
Returns Nothing
Example
    None


pseudo.RadioButton.create(pOwner:MovieClip, strName:String, nDepth:Number):pseudo.RadioButton
Use this static function to create new RadioButton on the specified movie clip. Never use constructor directly to do this (current version of RadioButton doesn't support classical round RadioButtons appearance, it was made as an extension to ToggleButton, so that a user could make only a single choice from a set of ToggleButtons).

Parameters pOwner The movie clip on which the new RadioButton will be drawn.
strName The new RadioButton instance name.
nDepth The new RadioButton instance depth.
Returns The reference to new RadioButton instance
Example
    var btn = pseudo.RadioButton.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("Button one");
    
    //set the radio buttons group name
    btn.setGroupName("group")
    
    //Add a listener to the button
    
    var args:Object = new Object();
    args.text = "doubleClick event was invoked for btn";
    btn.addListener("doubleClick", this, onDoSomething, args);
    
    //Calling these functions will finally draw the component
    
    btn.update();
    btn.draw();
    
    //add a second button
    
    var btn2 = pseudo.RadioButton.create(this, "btn2", 2);
    btn2.setSize(100, 20);
    
    //Apply the skin to the button
    
    btn2.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(btn2.addItem(pseudo.Label));
    lbl.setAlign("center");
    lbl.setText("Button two");
    
    btn2.setGroupName("group")
    
    //Position the second button
    btn2._y = btn._y + 30;
    
    //Add a listener to the button
    
    var args2:Object = new Object();
    args2.text = "doubleClick event was invoked for btn2";
    btn2.addListener("doubleClick", this, onDoSomething, args2);
    
    //Calling these functions will finally draw the component
    
    btn2.update();
    btn2.draw();
    
    //add a third button
    
    var btn3 = pseudo.RadioButton.create(this, "btn3", 3);
    btn3.setSize(100, 20);
    
    //Apply the skin to the button
    
    btn3.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(btn3.addItem(pseudo.Label));
    lbl.setAlign("center");
    lbl.setText("Button three");
    
    btn3.setGroupName("group")
    
    //Position the second button
    btn3._y = btn2._y + 30;
    
    //Calling these functions will finally draw the component
    btn3.update();
    btn3.draw();
    
    //Add a listener to the button
    var args3:Object = new Object();
    args3.text = "mouseRelease event was invoked for btn 3";
    btn3.addListener("doubleClick", this, onDoSomething, args3);
    
    //set the first button selected
    btn.setState("sunken");
    
    //Some function to handle the event
    
    function onDoSomething(args:Object):Void
    {
      trace(args.text);
    }
    
    // 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.RadioButton.setState(state:String):Void
Use this function set the RadioButton 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


pseudo.RadioButton.setGroupName(strGroupName:String):Void
Use this function set the name of the group to which this RadioButton instance belongs.

Parameters strGroupName String value that set the name of the group to which this radio button belongs
Returns Nothing
Example
    None


pseudo.RadioButton.setGroupName(strGroupName:String):Void
Use this function set the name of the group to which this RadioButton instance belongs

Parameters strGroupName String value that is used to set the name of the group to which this radio button belongs
Returns Nothing
Example
    None


pseudo.RadioButton.isGroupName(strGroupName:String):Boolean
Use this function to find out if the RadioButton group with a specific name exists

Parameters strGroupName String value indicating the name of the group that might exist
Returns Boolean true or false value
Example
    None
Flash UI Components (c)TUFaT.com, All Rights Reserved.