Packagekm.components
Classpublic class RadioGroup
InheritanceRadioGroup Inheritance UIComponent Inheritance 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
 PropertyDefined by
 Inheritedduotone : Array
The duotone property can be used to convert the colors of the component into duotone.
UIComponent
 Inheritedenabled : 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
 InheritedtoolTip : String
Text to use as toolTip when ToolTip is enabled.
UIComponent
 Inheritedx : Number
UIComponent
 Inheritedy : Number
UIComponent
Public Methods
 MethodDefined by
  
RadioGroup
  
addRadioButton(x:int = 0, y:int = 0, text:String = "", data:* = null):RadioButton
Adds a radio button to the group.
RadioGroup
 Inherited
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
 Inherited
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
 Inherited
setProperties(o:Object):void
Sets a number of properties at once.
UIComponent
Events
 EventSummaryDefined by
 Inherited The animationComplete event is broadcasted when an animated move is completed.UIComponent
   The change event is broadcasted when another radioButton is selected.RadioGroup
Property detail
onChangeproperty
public var onChange:Function

onChange handler.

radioButtonproperty 
radioButton:RadioButton  [read-only]

>> Reference to the default radio button.

Implementation
    public function get radioButton():RadioButton

See also

selectedproperty 
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
changeevent 
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.