KoolMoves AS3 API Documentation | All Packages | All Classes | Index | Frames No Frames |
Class CheckBox

Package | km.components
Class | public class CheckBox
Inheritance | CheckBox Label UIComponent flash.display.Sprite

The CheckBox component class.

Example

    // this example assumes a checkbox on stage named c
    // and a dynamic textfield named txt1

    c.setProperties({x:50, y:80, checked:true});
    c.text = 'Checkbox';
    c.onChange = function(){
     txt1.text = this.checked ? 'checked' : 'unchecked';
    }
    addChild(c);

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined by
--- | --- | ---
|  | align : String Horizontal alignment within the bounding box. Possible values are 'left', 'right' and 'center'. | Label
|  | antiAliasType : String | Label
|  | background : Boolean | Label
|  | backgroundColor : uint | Label
|  | checked : Boolean Gets or sets the check state. | CheckBox
|  | defaultTextFormat : TextFormat | Label
|  | displayAsPassword : Boolean | Label
|  | duotone : Array The duotone property can be used to convert the colors of the component into duotone. | UIComponent
|  | embedFonts : Boolean | Label
|  | enabled : Boolean Specifies if the component is enabled. If a component is disabled, it will be turned into grayscale and become partly transparent. | UIComponent
|  | gridFitType : String | Label
|  | height : Number | UIComponent
|  | htmlText : String | Label
|  | labelPlacement : String Placement of the label text. Possible values are 'left' and 'right'. | Label
|  | length : int | Label
|  | maxChars : int | Label
|  | onChange : Function onChange handler. | CheckBox
|  | restrict : String | Label
|  | sharpness : Number | Label
|  | text : String | Label
|  | textColor : uint | Label
|  | thickness : Number | Label
|  | toolTip : String Text to use as toolTip when ToolTip is enabled. | UIComponent
|  | type : String | Label
|  | valign : String Vertical alignment within the bounding box. Possible values are 'top', 'bottom' and 'center'. | Label
|  | width : Number | UIComponent
|  | wordWrap : Boolean | Label
|  | x : Number | UIComponent
|  | y : Number | UIComponent

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined by
--- | --- | ---
|  | CheckBox() | CheckBox
|  | clone():* Returns a clone of the component. The skin of the component is cloned but other things like the text of a label or the items of a list aren't. | UIComponent
|  | move(x:int, y:int, animationMode:int = 0, animationFrames:int = 12, easeInOut:Boolean = false):void Moves the component to the specified coordinates. | UIComponent
|  | setProperties(o:Object):void Sets a number of properties at once. | UIComponent
|  | setSize(w:int, h:int):void Sets the size width and height. | UIComponent
|  | setSkin(assetName:String, usePrefix:Boolean = true):void | CheckBox

Events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined by
--- | --- | --- | ---
|  | animationComplete | The animationComplete event is broadcasted when an animated move is completed. | UIComponent
|  | change | The change event is broadcasted when the checkBox is checked or uncheked. It's also possible to use the onChange handler. | CheckBox

Property detail

checked | property

`checked:Boolean` [read-write]

Gets or sets the check state.

Implementation
`public function get checked():Boolean`
`public function set checked(value:Boolean):void`

onChange | property |

`public var onChange:Function`

onChange handler.

Constructor detail

CheckBox | () | constructor

`public function CheckBox()`
Method detail

setSkin | () | method

`public function setSkin(assetName:String, usePrefix:Boolean = true):void`

Parameters

| `assetName:String`
| `usePrefix:Boolean` (default = `true`)``

See also

km.core.Image.setSkin()
Event detail

change | event

Event object type: `flash.events.Event`

The change event is broadcasted when the checkBox is checked or uncheked.
It's also possible to use the onChange handler.

Last update : 04/05/2008