Main Page | Packages | Class Tree | Index | Help

com.bjc.controls

class RadioButton

MovieClip
  |
  +--com.bjc.core.BJCComponent
        |
        +--com.bjc.core.LabelWrapper
              |
              +--com.bjc.controls.RadioButton


class RadioButton
extends LabelWrapper

A radio button for choosing a single value amongst several possibilities. All radio buttons placed within a particular movie clip or component will be grouped together, unless they are within the bounds of a GroupBox component in the same clip.

Events:

click - Fired whenever the user presses and releases the mouse button while on the radio button, changing its state.
focus - Fired whenever the component receives focus.
killFocus - Fired whenever the component loses focus.
tabFocus - Fired whenever the component receives focus by pressing the TAB key.


Author:
Flashloaded - www.flashloaded.com


Field Summary

public
addEventListener: Function
See the EventDispatcher Class in Flash Help

public
clickHandler: Function
Can be used to assign a direct event handler to the component instance.

public
focusHandler: Function
Can be used to assign a direct event handler to the component instance.

public
killFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

public
removeEventListener: Function
See the EventDispatcher Class in Flash Help

public
tabFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

Fields inherited from class com.bjc.core.BJCComponent

version

Property Summary

public
label: String (write)
Sets the text to display in the label of the radio button.

public
label: String (read)
Gets the text to display in the label of the radio button.

public
radioButtonGroup: Array (read-only)
An array containing all the radio buttons in this particular group. Mainly used internally to ensure that only one button is selected at a time.

public
radioButtonGroupName: String (write)
Sets the name of the radioButtonGroup that this button is assigned to. This is usually assigned internally, but can be used to set some buttons in one group, and some in another.

public
radioButtonGroupName: String (read)
Gets the name of the radioButtonGroup that this button is assigned to.

public
selected: Boolean (write)
Sets the selection mode of a radio button. This will fire the click event if the eventOnValue is set to true (changed in version 1.3).

public
selected: Boolean (read)
Gets the selection mode of a radio button.

Properties inherited from class com.bjc.core.LabelWrapper

align, disabledColor, disableStyles, embedFont, fontColor, fontFace, fontSize, html

Properties inherited from class com.bjc.core.BJCComponent

disabledAlpha, enabled, focusTime, height, keyEnabled, style, width

Constructor

public
RadioButton ( Void)


Method Summary

public static
create ( target: MovieClip, id: String, depth: Number, initObj: Object ): RadioButton
Static method used to create an instance of a RadioButton on stage at run time.

Methods inherited from class com.bjc.core.BJCComponent

draw, invalidate, move, remove, setSize



Field Documentation

addEventListener

public var addEventListener: Function
See the EventDispatcher Class in Flash Help

clickHandler

public var clickHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myRadioButton.clickHandler = function(){
trace("I was clicked.");
}

focusHandler

public var focusHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myRadioButton.focusHandler = function(){
trace("Set focus.");
}

killFocusHandler

public var killFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myRadioButton.killFocusHandler = function(){
trace("Kill focus.");
}

removeEventListener

public var removeEventListener: Function
See the EventDispatcher Class in Flash Help

tabFocusHandler

public var tabFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myRadioButton.tabFocusHandler = function(){
trace("Tab focus.");
}


Property Documentation

label

public label: String (write)
Sets the text to display in the label of the radio button.

Example:
radioButton1.label = "Choice 1";

label

public label: String (read)
Gets the text to display in the label of the radio button.

Example:
myVar = radioButton1.label;

radioButtonGroup

public radioButtonGroup: Array (read-only)
An array containing all the radio buttons in this particular group. Mainly used internally to ensure that only one button is selected at a time.

Example:
trace("there are " + radioButton1.radioButtonGroup.length + " buttons in this group.");

radioButtonGroupName

public radioButtonGroupName: String (write)
Sets the name of the radioButtonGroup that this button is assigned to. This is usually assigned internally, but can be used to set some buttons in one group, and some in another.

Example:
radioButton1.radioButtonGroupName = "group1";
radioButton2.radioButtonGroupName = "group1";
radioButton3.radioButtonGroupName = "group1";
radioButton4.radioButtonGroupName = "group2";
radioButton5.radioButtonGroupName = "group2";
radioButton6.radioButtonGroupName = "group2";
// this will cause radio buttons 1-3 to be in one group, and 4-6 to be in another.

radioButtonGroupName

public radioButtonGroupName: String (read)
Gets the name of the radioButtonGroup that this button is assigned to.

Example:
myVar = radioButton1.radioButtonGroupName;

selected

public selected: Boolean (write)
Sets the selection mode of a radio button. This will fire the click event if the eventOnValue is set to true (changed in version 1.3).

Example:
radioButton1.selected = true;

selected

public selected: Boolean (read)
Gets the selection mode of a radio button.

Example:
myVar = radioButton1.selected;


Constructor Documentation

RadioButton

public function RadioButton(Void)

Method Documentation

create

public static function create(target: MovieClip,
 id: String,
 depth: Number,
 initObj: Object): RadioButton
Static method used to create an instance of a RadioButton on stage at run time.

Parameters:
target
the movie clip to which the radio button will be attached.
id
the instance name given to the new radio button attached.
depth
the depth at which to attach the new radio button.
initObj
(optional) an object containing any properties you want to assign to the component when it is created
Returns:
a reference to the new radio button attached.

Example:
import com.bjc.controls.RadioButton;
var newRadioButton:RadioButton = RadioButton.create(_root, "myRadioButton", 0);


The documentation was generated from the following file:


Copyright Flashloaded - www.flashloaded.com