CheckBox Component
A check box is a square box that can be selected or deselected. When it is selected, a check mark appears in the box. You can add a text label to a check box and place it to the left, right, top, or bottom.
A check box can be enabled or disabled in an application. If a check box is enabled and a user clicks it or its label, the check box receives input focus and displays its pressed appearance. If a user moves the pointer outside the bounding area of a check box or its label while pressing the mouse button, the component’s appearance returns to its original state and it retains input focus. The state of a check box does not change until the mouse is released over the component. Additionally, the check box has two disabled states, selected and deselected, which do not allow mouse or keyboard interaction.
If a check box is disabled, it displays its disabled appearance, regardless of user interaction. In the disabled state, a button doesn’t receive mouse or keyboard input.
A CheckBox instance receives focus if a user clicks it or tabs to it.
AC_FL_RunContent( ‘codebase’,'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0′,’width’,’100′,’height’,’22′,’src’,’../c-image/checkbox’,'quality’,'high’,'pluginspage’,'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash’,'movie’,’../c-image/checkbox’ ); //end AC code
Below are parameters, properties, events and methods of CheckBox component. If you want to learn how to use CheckBox component in Sothink SWF Easy, you may link to page Use CheckBox.
1. Initialization Parameters:
Parameter | Description | Property Value | Default Value |
label | Sets the value of the text for the check box. | string | CheckBox |
labelPlacement | Orients the label text for the check box. This parameter can be one of four values: left, right, top, or bottom. | left, right, top or bottom | right |
selected | Sets the initial value of the check box to checked (true) or unchecked (false). | Boolean | false |
2. Properties:
Property | Description |
label | Sets the value of the text for the check box. The default value is CheckBox. |
labelPlacement | Orients the label text for the check box. This parameter can be one of four values: left, right, top, or bottom. The default value is right. |
selected | Sets the initial value of the check box to checked (true) or unchecked (false). The default value is false. |
3. Events:
Event | Description |
click | Broadcast when a button is clicked. |
resize | Broadcast when a button is resized. |
For event click, there are two ways to realize:
1:
var listenerObject:Object = new Object();
listenerObject.click = function(eventObject:Object) {
// …
};
checkBoxInstance.addEventListener(“click”, listenerObject);
2:
checkBoxInstance.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 CheckBox 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 of CheckBox. | 0xf8f8f8 |
borderColor | color value | The border color of CheckBox. | 0×666666 |
color | color value | The text color. | 0x1b1b1b |
disabledColor | color value | The color for text when the component is disabled. | 0xaaaaaa |
embedFonts | Boolean | 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 check mark. | 0×333333 |