| Package | km.components |
| Class | public class CheckBox |
| Inheritance | CheckBox Label UIComponent flash.display.Sprite |
// 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);
| 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 | |
| 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 | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
![]() | The animationComplete event is broadcasted when an animated move is completed. | UIComponent | ||
| The change event is broadcasted when the checkBox is checked or uncheked. It's also possible to use the onChange handler. | CheckBox | |||
| 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:FunctiononChange handler.
| CheckBox | () | constructor |
public function CheckBox()
| setSkin | () | method |
public function setSkin(assetName:String, usePrefix:Boolean = true):voidParameters
assetName:String |
|
usePrefix:Boolean (default = true) |
See also
| change | event |
flash.events.Event
The change event is broadcasted when the checkBox is checked or uncheked.
It's also possible to use the onChange handler.