Package | km.components |
Class | public class BaseButton |
Inheritance | BaseButton ![]() ![]() |
Subclasses | LabelButton |
Property | Defined by | ||
---|---|---|---|
![]() | duotone : 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 | ||
![]() | enabled : Boolean Specifies if the component is enabled.
If a component is disabled, it will be turned into grayscale and become partly transparent. | UIComponent | |
![]() | height : 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 | ||
![]() | toolTip : String Text to use as toolTip when ToolTip is enabled.
| UIComponent | |
![]() | width : Number | UIComponent | |
![]() | x : Number | UIComponent | |
![]() | y : Number | UIComponent |
Method | Defined by | ||
---|---|---|---|
BaseButton | |||
![]() |
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
Sets the skin asset.
| BaseButton | ||
setSound(mouseDownSound:Sound = null, mouseOverSound:Sound = null):void
Sets the sounds of a button.
| BaseButton |
Event | Summary | Defined by | ||
---|---|---|---|---|
![]() | 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 |
effectSpeed | property |
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
minHeight | property |
minHeight:int
[read-only]Returns the minimum height of the button based on its scaling grid.
Implementation public function get minHeight():int
minWidth | property |
minWidth:int
[read-only]Returns the minimum width of the button based on its scaling grid.
Implementation public function get minWidth():int
on | property |
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
onClick | property |
public var onClick:Function
onClick handler.
operationMode | property |
operationMode:int
[read-write] Specifies the operation mode of the button.
0 = normal, 1 = hold, 2 = switch.
public function get operationMode():int
public function set operationMode(value:int):void
origHeight | property |
origHeight:int
[read-only]Returns the original height of the button.
Implementation public function get origHeight():int
origWidth | property |
origWidth:int
[read-only]Returns the original width of the button.
Implementation public function get origWidth():int
smoothing | property |
smoothing:Boolean
[write-only]Sets the way the scaling grid is used.
Implementation public function set smoothing(value:Boolean):void
BaseButton | () | constructor |
public function BaseButton()
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.
ParametersassetName:String |
|
usePrefix:Boolean (default = true )
|
See also
setSound | () | method |
public function setSound(mouseDownSound:Sound = null, mouseOverSound:Sound = null):void
Sets the sounds of a button.
ParametersmouseDownSound:Sound (default = null )
|
|
mouseOverSound:Sound (default = null )
|
click | event |
flash.events.MouseEvent
The click event is broadcasted when the button is clicked.
It's also possible to use the onClick handler.