Packagekm.components
Classpublic class CheckBox
InheritanceCheckBox Inheritance Label Inheritance UIComponent Inheritance 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
 PropertyDefined by
 Inheritedalign : String
Horizontal alignment within the bounding box.
Possible values are 'left', 'right' and 'center'.
Label
 InheritedantiAliasType : String
Label
 Inheritedbackground : Boolean
Label
 InheritedbackgroundColor : uint
Label
  checked : Boolean
Gets or sets the check state.
CheckBox
 InheriteddefaultTextFormat : TextFormat
Label
 InheriteddisplayAsPassword : Boolean
Label
 Inheritedduotone : Array
The duotone property can be used to convert the colors of the component into duotone.
UIComponent
 InheritedembedFonts : Boolean
Label
 Inheritedenabled : Boolean
Specifies if the component is enabled.
If a component is disabled, it will be turned into grayscale and become partly transparent.
UIComponent
 InheritedgridFitType : String
Label
 Inheritedheight : Number
UIComponent
 InheritedhtmlText : String
Label
 InheritedlabelPlacement : String
Placement of the label text.
Possible values are 'left' and 'right'.
Label
 Inheritedlength : int
Label
 InheritedmaxChars : int
Label
  onChange : Function
onChange handler.
CheckBox
 Inheritedrestrict : String
Label
 Inheritedsharpness : Number
Label
 Inheritedtext : String
Label
 InheritedtextColor : uint
Label
 Inheritedthickness : Number
Label
 InheritedtoolTip : String
Text to use as toolTip when ToolTip is enabled.
UIComponent
 Inheritedtype : String
Label
 Inheritedvalign : String
Vertical alignment within the bounding box.
Possible values are 'top', 'bottom' and 'center'.
Label
 Inheritedwidth : Number
UIComponent
 InheritedwordWrap : Boolean
Label
 Inheritedx : Number
UIComponent
 Inheritedy : Number
UIComponent
Public Methods
 MethodDefined by
  
CheckBox
 Inherited
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
 Inherited
move(x:int, y:int, animationMode:int = 0, animationFrames:int = 12, easeInOut:Boolean = false):void
Moves the component to the specified coordinates.
UIComponent
 Inherited
setProperties(o:Object):void
Sets a number of properties at once.
UIComponent
 Inherited
setSize(w:int, h:int):void
Sets the size width and height.
UIComponent
  
setSkin(assetName:String, usePrefix:Boolean = true):void
CheckBox
Events
 EventSummaryDefined by
 Inherited 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
Property detail
checkedproperty
checked:Boolean  [read-write]

Gets or sets the check state.

Implementation
    public function get checked():Boolean
    public function set checked(value:Boolean):void
onChangeproperty 
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
changeevent 
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.