RadioButton Component
The RadioButton component lets you force a user to make a single choice within a set of choices. This component must be used in a group of at least two RadioButton instances. Only one member of the group can be selected at any given time. Selecting one radio button in a group deselects the currently selected radio button in the group. You set the groupName parameter to indicate which group a radio button belongs to.
A radio button can be enabled or disabled. A disabled radio button doesn’t receive mouse or keyboard input. When the user clicks or tabs into a RadioButton component group, only the selected radio button receives focus.
AC_FL_RunContent( ‘codebase’,'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0′,’width’,’100′,’height’,’49′,’src’,’../c-image/radiobutton’,'quality’,'high’,'pluginspage’,'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash’,'movie’,’../c-image/radiobutton’ ); //end AC code
Below are parameters, properties, events and methods of RadioButton component. If you want to learn how to use RadioButton component in Sothink SWF Easy, you may link to page Use RadioButton.
1. Initialization Parameters:
Parameter | Description | Property Value | Default Value |
data | The value associated with the radio button. | ANY VALUE | NONE |
groupName | The group name of the radio button. | string | “radioGroup” |
label | Sets the value of the text on the button. | string | “Radio Button” |
labelPlacement | Orients the label text on the button. This parameter can be one of four values: left, right, top, or bottom. | “right”, “left”, “bottom” or “top” | “right” |
selected | Sets the initial value of the radio button to selected (true) or unselected (false). A selected radio button displays a dot inside it. Only one radio button in a group can have a selected value of true. If more than one radio button in a group is set to true, the radio button that is instantiated last is selected. | Boolean | false |
2. Properties:
Property | Description |
data | The value associated with a radio button instance. |
groupName | The group name for a radio button group instance or a radio button instance. |
label | The text that appears next to a radio button. |
labelPlacement | The orientation of the label text in relation to a radio button or a radio button group. |
selected | Selects the radio button, and deselects the previously selected radio button. This property can be used with a RadioButton instance or a RadioButtonGroup instance. |
selectedData | Selects the radio button with the specified data value in a radio button group. |
selection | A reference to the currently selected radio button in a radio button group. This property can be used with a RadioButton instance or a RadioButtonGroup instance. |
enabled | Indicates whether the component can receive focus and input. |
3. Events:
Event | Description |
click | Broadcast when a button is clicked. |
resize | Broadcast when a button is resized. |
For event click, there are four ways to realize:
1:
var listenerObject:Object = new Object();
listenerObject.click = function(eventObject:Object) {
// …
};
radioButtonGroup.addEventListener(“click”, listenerObject);
2:
radioButtonGroup.click = function(eventObj:Object){
// …
};
3:
var listenerObject:Object = new Object();
listenerObject.click = function(eventObject:Object) {
// …
};
radioButtonInstance.addEventListener(“click”, listenerObject);
4:
radioButtonInstance..click = function(eventObj:Object){
// …
};
4. Methods:
Method | Property | Description |
setSize | (width, height, noEvent) | Resizes the object to the requested size. |
setStyle | (propertyName, propertyValue) | Sets the style property on the style declaration or object. |
For RadioButton component, method setStyle has many properties settings.
propertyName | propertyValue | Description | Default Value |
themeColor | color value | The base color scheme of a component. | 0×0 |
backgroundColor | color value | The background color. | 0xf8f8f8 |
borderColor | color value | The border color. | 0×666666 |
color | color value | The text color. | 0x1b1b1b |
disabledColor | color value | The color for text when the component is disabled. | 0xaaaaaa |
embedFonts | Boolean | A Boolean value that indicates whether the font specified in fontFamily is an embedded font. This style must be set to true if fontFamily refers to an embedded font. Otherwise, the embedded font is not used. If this style is set to true and fontFamily does not refer to an embedded font, no text is displayed. | false |
fontFamily | font name | The font name for text. | _sans |
fontSize | font size | The point size for the font. | 12 |
fontStyle | normal or italic | The font style. | normal |
fontWeight | none or bold | The font weight. | none |
textDecoration | none or underline | The text decoration | none |
symbolColor | color value | The color of the dot in the RadioButton. | 0×333333 |