Packagecom.gestureworks.cml.element
Classpublic class RadioButtons
InheritanceRadioButtons Inheritance Container Inheritance ContainerFactory Inheritance ElementFactory Inheritance flash.display.Sprite

The RadioButtons element represents a group of radio buttons generated from a user defined list of labels. Other configurable properties include the primary font characteristics (style, size, and color), placement direction (right to left or top to bottom), and the spacing between the buttons.
                 
        var rButtons:RadioButtons = new RadioButtons("A,B,C,D,E");
        rButtons.x = 200;
        rButtons.y = 200;
        rButtons.labels = "Abracadabra,B,C,D,E,f,g,h,i,k";            
        rButtons.fontColor = 0xFF0216;            
        rButtons.verticalOffset = 70;
        rButtons.update();
        rButtons.addEventListener(StateEvent.CHANGE, testRBSelect);
        addChild(rButtons);
        
        
        function testRBSelect(event:StateEvent):void
        {
            //trace(event.value);
        }    

     

See also

Button
DropDownMenu


Public Properties
 PropertyDefined By
  absOffset : Boolean = false
RadioButtons
 Inheritedalpha : Number
[override] [write-only] sets the alpha for display objects
ElementFactory
 Inheritedblur : Boolean
Sets the drop shadow effect
ElementFactory
 Inheritedbottom : Number
sets the bottom value
ElementFactory
 InheritedchildList : ChildList
[read-only] store the child list
ContainerFactory
 Inheritedclass_ : String
Object's css class;
ElementFactory
 InheritedclassName : String
sets the class name of displayobject
ElementFactory
 InheritedcmlIndex : int
sets the cml index
ElementFactory
 InheriteddebugStyle : *
sets the debug style
ElementFactory
 InheriteddimensionsTo : String
sets the dimensions of the container
ContainerFactory
 InheriteddisplayEvents : String
Use for dispatch completes.
ElementFactory
 InheriteddropShadow : Boolean
Sets the drop shadow effect
ElementFactory
  fontAlpha : Number
The alpha for the labels.
RadioButtons
  fontColor : uint
RadioButtons
  fontSize : Number
RadioButtons
  fontStyle : String
RadioButtons
  graphicReps : String
A comma delimited string of ids of display objects to use for buttons.
RadioButtons
 Inheritedheight : Number
[override] Sets width of the display object in pixels
ElementFactory
 InheritedheightPercent : String
sets the height percent of display object
ElementFactory
 InheritedhorizontalCenter : Number
sets the horizontal center of display object
ElementFactory
  horizontalOffset : Number
RadioButtons
 Inheritedid : String
sets the id of child
ElementFactory
 Inheritedindex : int
sets the index of display object
ElementFactory
 InheritedinfoSource : String
sets info source
ContainerFactory
  labels : String
RadioButtons
 Inheritedlayout : *
Sets the layout of the container
Container
 InheritedlayoutComplete : Function
Sets the function to call when the layout is complete
Container
 InheritedlayoutList : Dictionary
Defines the layoutlist
Container
 InheritedlayoutUpdate : Function
Sets the function to call when the layout updates
Container
 Inheritedleft : Number
sets left value
ElementFactory
 InheritedpaddingBottom : Number
Sets the number of pixels between the container's bottom border and the bottom of its content area.
Container
 InheritedpaddingLeft : Number
Sets the number of pixels between the component's left border and the left edge of its content area.
Container
 InheritedpaddingRight : Number
Sets the number of pixels between the component's right border and the right edge of its content area.
Container
 InheritedpaddingTop : Number
Sets the number of pixels between the container's top border and the top of its content area.
Container
  pageButtons : Boolean
Set whether or not the buttons are being used for pagination.
RadioButtons
 Inheritedposition : String
Sets the position
Container
 InheritedpropertyStates : Array
Deprecated: Please Use state
ElementFactory
  radioButtons : Dictionary
[read-only]
RadioButtons
  radioColor : uint
The color for the radio buttons;
RadioButtons
  radioStroke : Number
The stroke of the radio button's graphic.
RadioButtons
  radioStrokeColor : uint
The color of a radio button's stroke;
RadioButtons
 Inheritedright : Number
sets the right value
ElementFactory
 Inheritedscale : Number
Sets both the x and y scale values
ElementFactory
 InheritedscaleX : Number
[override] Sets width of the display object in pixels
ElementFactory
 InheritedscaleY : Number
[override] Sets width of the display object in pixels
ElementFactory
  selectedColor : uint
The color of the fill of the selected radio button;
RadioButtons
  selectedFillRatio : Number
The amount of fill when the radio button is selected.
RadioButtons
  selectedLabel : String
[read-only] The currently selected label
RadioButtons
 Inheritedstate : Array
property states array
ElementFactory
  textEls : Dictionary
[read-only]
RadioButtons
 Inheritedtop : Number
sets top value
ElementFactory
 InheritedverticalCenter : Number
sets the vertical center of display object
ElementFactory
  verticalLayout : Boolean
RadioButtons
  verticalOffset : Number
RadioButtons
 Inheritedwidth : Number
[override] Sets width of the display object in pixels
ElementFactory
 InheritedwidthPercent : String
sets the percent of width of display object
ElementFactory
Public Methods
 MethodDefined By
  
RadioButtons(labels:String = null)
RadioButton Constructor.
RadioButtons
 Inherited
This method searches the childlist and add the children
ContainerFactory
 Inherited
addChild(child:DisplayObject):DisplayObject
[override] Adds child to display list and, if not already added, the child list TODO: This mechanism should be abstracted to better syncrhonize child and display lists
Container
 Inherited
applyLayout(value:* = null):void
Apply the containers layout
Container
 Inherited
childToList(id:String, child:*):void
this method append to the childlist
ContainerFactory
 Inherited
clone():*
Returns clone of self
ElementFactory
  
[override] CML display initialization callback
RadioButtons
  
dispose():void
[override] Dispose methods and remove listeners
RadioButtons
 Inherited
getIndex(index:int):*
returns childlist index
Container
 Inherited
getKey(key:String):*
returns the childlist key
Container
 Inherited
hideIndex(index:int):void
hides the childlist index
Container
 Inherited
hideKey(key:String):void
hides the childlist key
Container
  
init():void
[override] Initializes the configuration and display of the RadioButtons
RadioButtons
 Inherited
parseCML(cml:XMLList):XMLList
[override] Parse cml for local layouts.
Container
 Inherited
postparseCML(cml:XMLList):void
post parses the cml file
ElementFactory
 Inherited
searchChildren(value:*, returnType:Class = null):*
This method does a depth first search of childLists.
Container
  
selectButton(s:String):void
RadioButtons
 Inherited
This method sets the dimensions of childlist
ContainerFactory
 Inherited
showIndex(index:int):void
shows the childlist index
Container
 Inherited
showKey(key:String):void
shows the childlist key
Container
  
update():void
Re-draws the display to incorporate any changes.
RadioButtons
 Inherited
updateProperties(state:Number = 0):void
this method updates the properties
ElementFactory
Property Detail
absOffsetproperty
public var absOffset:Boolean = false

fontAlphaproperty 
fontAlpha:Number

The alpha for the labels.


Implementation
    public function get fontAlpha():Number
    public function set fontAlpha(value:Number):void
fontColorproperty 
fontColor:uint


Implementation
    public function get fontColor():uint
    public function set fontColor(value:uint):void
fontSizeproperty 
fontSize:Number


Implementation
    public function get fontSize():Number
    public function set fontSize(value:Number):void
fontStyleproperty 
fontStyle:String


Implementation
    public function get fontStyle():String
    public function set fontStyle(value:String):void
graphicRepsproperty 
graphicReps:String

A comma delimited string of ids of display objects to use for buttons. If a display object is selected this way, its alpha will be dimmed when not selected.


Implementation
    public function get graphicReps():String
    public function set graphicReps(value:String):void
horizontalOffsetproperty 
horizontalOffset:Number


Implementation
    public function get horizontalOffset():Number
    public function set horizontalOffset(value:Number):void
labelsproperty 
labels:String


Implementation
    public function get labels():String
    public function set labels(value:String):void
pageButtonsproperty 
pageButtons:Boolean

Set whether or not the buttons are being used for pagination. This will automatically add arrows to either side of the buttons the same color as them.


Implementation
    public function get pageButtons():Boolean
    public function set pageButtons(value:Boolean):void
radioButtonsproperty 
radioButtons:Dictionary  [read-only]


Implementation
    public function get radioButtons():Dictionary
radioColorproperty 
radioColor:uint

The color for the radio buttons;


Implementation
    public function get radioColor():uint
    public function set radioColor(value:uint):void
radioStrokeproperty 
radioStroke:Number

The stroke of the radio button's graphic.


Implementation
    public function get radioStroke():Number
    public function set radioStroke(value:Number):void
radioStrokeColorproperty 
radioStrokeColor:uint

The color of a radio button's stroke;


Implementation
    public function get radioStrokeColor():uint
    public function set radioStrokeColor(value:uint):void
selectedColorproperty 
selectedColor:uint

The color of the fill of the selected radio button;


Implementation
    public function get selectedColor():uint
    public function set selectedColor(value:uint):void
selectedFillRatioproperty 
selectedFillRatio:Number

The amount of fill when the radio button is selected.


Implementation
    public function get selectedFillRatio():Number
    public function set selectedFillRatio(value:Number):void
selectedLabelproperty 
selectedLabel:String  [read-only]

The currently selected label


Implementation
    public function get selectedLabel():String
textElsproperty 
textEls:Dictionary  [read-only]


Implementation
    public function get textEls():Dictionary
verticalLayoutproperty 
verticalLayout:Boolean


Implementation
    public function get verticalLayout():Boolean
    public function set verticalLayout(value:Boolean):void
verticalOffsetproperty 
verticalOffset:Number


Implementation
    public function get verticalOffset():Number
    public function set verticalOffset(value:Number):void
Constructor Detail
RadioButtons()Constructor
public function RadioButtons(labels:String = null)

RadioButton Constructor. Allows users to define a group of radio buttons by passing a comma delimited string containing label names.

Parameters
labels:String (default = null) — the comma delimited list of labels
Method Detail
displayComplete()method
override public function displayComplete():void

CML display initialization callback

dispose()method 
override public function dispose():void

Dispose methods and remove listeners

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

Initializes the configuration and display of the RadioButtons

selectButton()method 
public function selectButton(s:String):void

Parameters

s:String

update()method 
public function update():void

Re-draws the display to incorporate any changes.