KoolMoves AS3 API Documentation | All Packages | All Classes | Index | Frames No Frames |
Class RadioGroup

Package | km.components
Class | public class RadioGroup
Inheritance | RadioGroup UIComponent flash.display.Sprite

The RadioGroup component class.

Example

    // this example assumes a dynamic textfield on stage
    // named txt1 and a radiobutton image embedded in the
    // swf movie with classname 'radiobutton' assigned to
    // it.

    import km.core.*;
    import km.components.*;

    var rg:RadioGroup = new RadioGroup();
    rg.radioButton.setSkin('radiobutton');

    rg.selected = rg.addRadioButton(0,0,'Item 1');
    rg.addRadioButton(0,20,'Item 2');
    rg.addRadioButton(0,40,'Item 3');

    rg.onChange = function(){
     txt1.text = this.selected.text + ' selected';
    }

    rg.x = 340; rg.y = 50;
    addChild(rg);

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined by
--- | --- | ---
|  | duotone : Array The duotone property can be used to convert the colors of the component into duotone. | UIComponent
|  | enabled : Boolean Specifies if the component is enabled. If a component is disabled, it will be turned into grayscale and become partly transparent. | UIComponent
|  | onChange : Function onChange handler. | RadioGroup
|  | radioButton : RadioButton [read-only] >> Reference to the default radio button. | RadioGroup
|  | selected : RadioButton Gets or sets the selected radio button. | RadioGroup
|  | toolTip : String Text to use as toolTip when ToolTip is enabled. | UIComponent
|  | x : Number | UIComponent
|  | y : Number | UIComponent

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined by
--- | --- | ---
|  | RadioGroup() | RadioGroup
|  | addRadioButton(x:int = 0, y:int = 0, text:String = "", data:* = null):RadioButton Adds a radio button to the group. | RadioGroup
|  | clone():* Returns a clone of the component. The skin of the component is cloned but other things like the text of a label or the items of a list aren't. | UIComponent
|  | move(x:int, y:int, animationMode:int = 0, animationFrames:int = 12, easeInOut:Boolean = false):void Moves the component to the specified coordinates. | UIComponent
|  | removeRadioButton(button:RadioButton):void Removes a radio button from the group. | RadioGroup
|  | setProperties(o:Object):void Sets a number of properties at once. | UIComponent

Events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined by
--- | --- | --- | ---
|  | animationComplete | The animationComplete event is broadcasted when an animated move is completed. | UIComponent
|  | change | The change event is broadcasted when another radioButton is selected. | RadioGroup

Property detail

onChange | property

`public var onChange:Function`

onChange handler.

radioButton | property |

`radioButton:RadioButton` [read-only]

>> Reference to the default radio button.

Implementation
`public function get radioButton():RadioButton`

See also

The CheckBox component for the styling capabilities of a RadioButton.

selected | property |

`selected:RadioButton` [read-write]

Gets or sets the selected radio button.

Implementation
`public function get selected():RadioButton`
`public function set selected(value:RadioButton):void`
Constructor detail

RadioGroup | () | constructor

`public function RadioGroup()`
Method detail

addRadioButton | () | method

`public function addRadioButton(x:int = 0, y:int = 0, text:String = "", data:* = null):RadioButton`

Adds a radio button to the group.

Parameters

| `x:int` (default = `0`)`` — x
| `y:int` (default = `0`)`` — y
| `text:String` (default = "``")`` — The label text of the radio button.
| `data:*` (default = `null`)`` — The data associated with the radio button.

Returns

| `RadioButton` — A reference to the button that was added.

removeRadioButton | () | method |

`public function removeRadioButton(button:RadioButton):void`

Removes a radio button from the group.

Parameters

| `button:RadioButton`

Event detail

change | event

Event object type: `flash.events.Event`

The change event is broadcasted when another radioButton is selected. It's also possible to use the onChange handler.

Last update : 04/05/2008