| Package | km.components |
| Class | public class RadioGroup |
| Inheritance | RadioGroup UIComponent flash.display.Sprite |
// 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);
| 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 | |
| Method | Defined by | ||
|---|---|---|---|
| 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 | |
| Event | Summary | Defined by | ||
|---|---|---|---|---|
![]() | The animationComplete event is broadcasted when an animated move is completed. | UIComponent | ||
| The change event is broadcasted when another radioButton is selected. | RadioGroup | |||
| onChange | property |
public var onChange:FunctiononChange handler.
| radioButton | property |
radioButton:RadioButton [read-only]>> Reference to the default radio button.
Implementation public function get radioButton():RadioButton
See also
| 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
| RadioGroup | () | constructor |
public function RadioGroup()
| addRadioButton | () | method |
public function addRadioButton(x:int = 0, y:int = 0, text:String = "", data:* = null):RadioButtonAdds a radio button to the group.
Parametersx: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.
|
RadioButton — A reference to the button that was added.
|
| removeRadioButton | () | method |
public function removeRadioButton(button:RadioButton):voidRemoves a radio button from the group.
Parametersbutton:RadioButton |
| change | event |
flash.events.Event
The change event is broadcasted when another radioButton is selected. It's also possible to use the onChange handler.