Packagekm.components
Classpublic class BaseButton
InheritanceBaseButton Inheritance UIComponent Inheritance flash.display.Sprite
SubclassesLabelButton

The BaseButton class is the base class for button components.



Public Properties
 PropertyDefined by
 Inheritedduotone : Array
The duotone property can be used to convert the colors of the component into duotone.
UIComponent
  effectSpeed : int
Speed in msec of the mouse over fade effect.
BaseButton
 Inheritedenabled : Boolean
Specifies if the component is enabled.
If a component is disabled, it will be turned into grayscale and become partly transparent.
UIComponent
 Inheritedheight : Number
UIComponent
  minHeight : int
[read-only] Returns the minimum height of the button based on its scaling grid.
BaseButton
  minWidth : int
[read-only] Returns the minimum width of the button based on its scaling grid.
BaseButton
  on : Boolean
Specifies the on/off state when the button is operating in hold or switch mode.
BaseButton
  onClick : Function
onClick handler.
BaseButton
  operationMode : int
Specifies the operation mode of the button.
0 = normal, 1 = hold, 2 = switch.
BaseButton
  origHeight : int
[read-only] Returns the original height of the button.
BaseButton
  origWidth : int
[read-only] Returns the original width of the button.
BaseButton
  smoothing : Boolean
[write-only] Sets the way the scaling grid is used.
BaseButton
 InheritedtoolTip : String
Text to use as toolTip when ToolTip is enabled.
UIComponent
 Inheritedwidth : Number
UIComponent
 Inheritedx : Number
UIComponent
 Inheritedy : Number
UIComponent
Public Methods
 MethodDefined by
  
BaseButton
 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
Sets the skin asset.
BaseButton
  
setSound(mouseDownSound:Sound = null, mouseOverSound:Sound = null):void
Sets the sounds of a button.
BaseButton
Events
 EventSummaryDefined by
 Inherited The animationComplete event is broadcasted when an animated move is completed.UIComponent
   The click event is broadcasted when the button is clicked.
It's also possible to use the onClick handler.
BaseButton
Property detail
effectSpeedproperty
effectSpeed:int  [read-write]

Speed in msec of the mouse over fade effect. When this value is non zero, the up and over states are displayed using a cross fade. In this case, when the button is in up or over state, the up state will be visible all the time and the over state alpha will change.

Implementation
    public function get effectSpeed():int
    public function set effectSpeed(value:int):void
minHeightproperty 
minHeight:int  [read-only]

Returns the minimum height of the button based on its scaling grid.

Implementation
    public function get minHeight():int
minWidthproperty 
minWidth:int  [read-only]

Returns the minimum width of the button based on its scaling grid.

Implementation
    public function get minWidth():int
onproperty 
on:Boolean  [read-write]

Specifies the on/off state when the button is operating in hold or switch mode.

Implementation
    public function get on():Boolean
    public function set on(value:Boolean):void
onClickproperty 
public var onClick:Function

onClick handler.

operationModeproperty 
operationMode:int  [read-write]

Specifies the operation mode of the button.
0 = normal, 1 = hold, 2 = switch.

Implementation
    public function get operationMode():int
    public function set operationMode(value:int):void
origHeightproperty 
origHeight:int  [read-only]

Returns the original height of the button.

Implementation
    public function get origHeight():int
origWidthproperty 
origWidth:int  [read-only]

Returns the original width of the button.

Implementation
    public function get origWidth():int
smoothingproperty 
smoothing:Boolean  [write-only]

Sets the way the scaling grid is used.

Implementation
    public function set smoothing(value:Boolean):void
Constructor detail
BaseButton()constructor
public function BaseButton()
Method detail
setSkin()method
public function setSkin(assetName:String, usePrefix:Boolean = true):void

Sets the skin asset. It works the same as for the Image class. The difference is that the bitmap image to use has to be a three state image. This means the image has to contain the up, over and down states below eachother in one single file.

Parameters
assetName:String
 
usePrefix:Boolean (default = true)

See also

km.core.Image.setSkin()
setSound()method 
public function setSound(mouseDownSound:Sound = null, mouseOverSound:Sound = null):void

Sets the sounds of a button.

Parameters
mouseDownSound:Sound (default = null)
 
mouseOverSound:Sound (default = null)
Event detail
clickevent 
Event object type: flash.events.MouseEvent

The click event is broadcasted when the button is clicked.
It's also possible to use the onClick handler.