Package com.bit101.components
Class public class RadioButton
Inheritance RadioButton InheritanceComponent Inheritance flash.display.Sprite



Public Properties
  Property Defined By
  Inherited enabled : Boolean
Sets/gets whether this component is enabled or not.
Component
    groupName : String
Sets / gets the group name, which allows groups of RadioButtons to function seperately.
RadioButton
  Inherited height : Number
[override] Sets/gets the height of the component.
Component
    label : String
Sets / gets the label text shown on this CheckBox.
RadioButton
    selected : Boolean
Sets / gets the selected state of this CheckBox.
RadioButton
  Inherited tag : int
Sets/gets in integer that can identify the component.
Component
  Inherited width : Number
[override] Sets/gets the width of the component.
Component
  Inherited x : Number
[override] [write-only] Overrides the setter for x to always place the component on a whole pixel.
Component
  Inherited y : Number
[override] [write-only] Overrides the setter for y to always place the component on a whole pixel.
Component
Protected Properties
  Property Defined By
    _back : Sprite
RadioButton
    _button : Sprite
RadioButton
    buttons : Array
[static]
RadioButton
  Inherited _enabled : Boolean = true
Component
    _groupName : String = defaultRadioGroup
RadioButton
  Inherited _height : Number = 0
Component
    _label : Label
RadioButton
    _labelText : String
RadioButton
  Inherited Ronda : Class
Component
    _selected : Boolean = false
RadioButton
  Inherited _tag : int = -1
Component
  Inherited _width : Number = 0
Component
Public Methods
  Method Defined By
   
RadioButton(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, label:String, checked:Boolean = false, defaultHandler:Function = null)
Constructor
RadioButton
   
draw():void
[override] Draws the visual ui of the component.
RadioButton
  Inherited
initStage(stage:Stage):void
[static] Utility method to set up usual stage align and scaling.
Component
  Inherited
move(xpos:Number, ypos:Number):void
Moves the component to the specified position.
Component
  Inherited
setSize(w:Number, h:Number):void
Sets the size of the component.
Component
Protected Methods
  Method Defined By
   
[static] Static method to add the newly created RadioButton to the list of buttons in the group.
RadioButton
   
addChildren():void
[override] Creates and adds the child display objects of this component.
RadioButton
   
clear(rb:RadioButton):void
[static] Unselects all RadioButtons in the group, except the one passed.
RadioButton
  Inherited
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
Component
   
init():void
[override] Initializes the component.
RadioButton
  Inherited
invalidate():void
Marks the component to be redrawn on the next frame.
Component
   
onClick(event:MouseEvent):void
Internal click handler.
RadioButton
  Inherited
onInvalidate(event:Event):void
Called one frame after invalidate is called.
Component
Public Constants
  Constant Defined By
  Inherited DRAW : String = draw
[static]
Component
Property Detail
_back property
protected var _back:Sprite

_button property  
protected var _button:Sprite

_groupName property  
protected var _groupName:String = defaultRadioGroup

_label property  
protected var _label:Label

_labelText property  
protected var _labelText:String

_selected property  
protected var _selected:Boolean = false

buttons property  
protected static var buttons:Array

groupName property  
groupName:String

Sets / gets the group name, which allows groups of RadioButtons to function seperately.


Implementation
    public function get groupName():String
    public function set groupName(value:String):void
label property  
label:String

Sets / gets the label text shown on this CheckBox.


Implementation
    public function get label():String
    public function set label(value:String):void
selected property  
selected:Boolean

Sets / gets the selected state of this CheckBox.


Implementation
    public function get selected():Boolean
    public function set selected(value:Boolean):void
Constructor Detail
RadioButton () Constructor
public function RadioButton(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, label:String, checked:Boolean = false, defaultHandler:Function = null)

Constructor

Parameters
parent:DisplayObjectContainer (default = null) — The parent DisplayObjectContainer on which to add this RadioButton.
 
xpos:Number (default = 0) — The x position to place this component.
 
ypos:Number (default = 0) — The y position to place this component.
 
label:String — The string to use for the initial label of this component.
 
checked:Boolean (default = false) — The event handling function to handle the default event for this component (click in this case).
 
defaultHandler:Function (default = null)
Method Detail
addButton () method
protected static function addButton(rb:RadioButton):void

Static method to add the newly created RadioButton to the list of buttons in the group.

Parameters

rb:RadioButton — The RadioButton to add.
addChildren () method  
override protected function addChildren():void

Creates and adds the child display objects of this component.

clear () method  
protected static function clear(rb:RadioButton):void

Unselects all RadioButtons in the group, except the one passed. This could use some rethinking or better naming.

Parameters

rb:RadioButton — The RadioButton to remain selected.
draw () method  
override public function draw():void

Draws the visual ui of the component.

init () method  
override protected function init():void

Initializes the component.

onClick () method  
protected function onClick(event:MouseEvent):void

Internal click handler.

Parameters

event:MouseEvent — The MouseEvent passed by the system.