Packageverlocity.display.ui
Classpublic class Button
InheritanceButton Inheritance Text Inheritance UIElement Inheritance flash.display.Sprite
Subclasses PauseButton



Public Properties
 PropertyDefined By
 InheritedoriginX : Number
UIElement
 InheritedoriginY : Number
UIElement
Protected Properties
 PropertyDefined By
  bIsDisabled : Boolean
Button
  bIsHighlighted : Boolean
Button
  bIsSelected : Boolean
Button
  bMouseOver : Boolean
Button
  fCondition : Function
Button
  fFunction : Function
Button
  iState : int
Button
 InheritednScale : Number
UIElement
 InheritedtfTextField : TextField
Text
 InheritedtfTextFormat : TextFormat
Text
Public Methods
 MethodDefined By
  
Button(fSetFunction:Function = null, fSetCondition:Function = null, bAddToKeyInput:Boolean = true)
Button
 Inherited
Clear():void
Clears all graphics drawn on the UI element.
UIElement
  
Dispose():void
[override] Destroys the entire button
Button
  
DoButton():void
Preforms the button's function
Button
 Inherited
DrawRect(uiColor:uint = 0xFFFFFF, nAlpha:Number = 1, iWidth:int = 0, iHeight:int = 0, bLine:Boolean = false, iLineThickness:int = 1, uiLineColor:uint = 0xFFFFFF, nLineAlpha:Number = 1, bRounded:Boolean = false, iRoundness:int = 10, iOffsetX:int = 0, iOffsetY:int = 1):void
[override]
Text
 Inherited
GetHeight():int
Text
 Inherited
GetScale():Number
Returns the scale of the UI element.
UIElement
  
GetState():int
Returns the current state of the button.
Button
 Inherited
GetWidth():int
Text
  
IsDisabled():Boolean
Returns if the button is disabled
Button
  
IsHighlighted():Boolean
Returns if the button is highlighted
Button
  
IsSelected():Boolean
Returns if the button is selected
Button
  
Removes the condition of the button.
Button
 Inherited
ResetPos():void
Resets the X and Y position of the UI element to its original spawn position.
UIElement
  
ResetState():void
Resets the state of the button to its default.
Button
  
SetButton(fSetFunction:Function, fSetCondition:Function = null):void
Sets the functions of the button
Button
  
SetEnabled(bEnable:Boolean):void
Enables/disables the button for use
Button
 Inherited
SetHeight(iHeight:int):void
Text
  
SetHighlighted(bHighlight:Boolean):void
Enables/disables highlighting the button, as if the mouse was over it.
Button
 Inherited
SetOriginPos(nPosX:Number, nPosY:Number):void
Overrides origin position
UIElement
 Inherited
SetPos(nPosX:Number, nPosY:Number):void
Sets the X and Y position of the UI element.
UIElement
 Inherited
SetScale(nSetScale:Number):void
Sets the scale of the UI element.
UIElement
  
SetSelected(bSelect:Boolean):void
Enables/disables selection of the button.
Button
  
SetText(sText:String, tfTextFormat:TextFormat = null):void
[override] Sets the text to display on the button
Button
 Inherited
SetTextColor(uiColor:uint):void
Text
  
SetWidth(iWidth:int):void
[override] Sets the width of the button
Button
Protected Methods
 MethodDefined By
  
Disabled():void
Button
  
Down():void
Button
  
DrawBG():void
Button
  
Out():void
Button
  
Over():void
Button
  
Press():void
Button
  
Selected():void
Button
  
Up():void
Button
Public Constants
 ConstantDefined By
  STATE_DISABLED : int = 4
Button
  STATE_DOWN : int = 3
Button
  STATE_OUT : int = 1
Button
  STATE_OVER : int = 2
Button
  STATE_SELECTED : int = 5
Button
  STATE_UP : int = 0
Button
Property Detail
bIsDisabledproperty
protected var bIsDisabled:Boolean

bIsHighlightedproperty 
protected var bIsHighlighted:Boolean

bIsSelectedproperty 
protected var bIsSelected:Boolean

bMouseOverproperty 
protected var bMouseOver:Boolean

fConditionproperty 
protected var fCondition:Function

fFunctionproperty 
protected var fFunction:Function

iStateproperty 
protected var iState:int

Constructor Detail
Button()Constructor
public function Button(fSetFunction:Function = null, fSetCondition:Function = null, bAddToKeyInput:Boolean = true)



Parameters
fSetFunction:Function (default = null)
 
fSetCondition:Function (default = null)
 
bAddToKeyInput:Boolean (default = true)
Method Detail
Disabled()method
protected function Disabled():void

Dispose()method 
override public function Dispose():void

Destroys the entire button

DoButton()method 
public function DoButton():void

Preforms the button's function

Down()method 
protected function Down():void

DrawBG()method 
protected function DrawBG():void

GetState()method 
public function GetState():int

Returns the current state of the button.

Returns
int
IsDisabled()method 
public function IsDisabled():Boolean

Returns if the button is disabled

Returns
Boolean
IsHighlighted()method 
public function IsHighlighted():Boolean

Returns if the button is highlighted

Returns
Boolean
IsSelected()method 
public function IsSelected():Boolean

Returns if the button is selected

Returns
Boolean
Out()method 
protected function Out():void

Over()method 
protected function Over():void

Press()method 
protected function Press():void

RemoveCondition()method 
public function RemoveCondition():void

Removes the condition of the button.

ResetState()method 
public function ResetState():void

Resets the state of the button to its default.

Selected()method 
protected function Selected():void

SetButton()method 
public function SetButton(fSetFunction:Function, fSetCondition:Function = null):void

Sets the functions of the button

Parameters

fSetFunction:Function — The function the button preforms
 
fSetCondition:Function (default = null) — The conditional to check if the button should be selected or not

SetEnabled()method 
public function SetEnabled(bEnable:Boolean):void

Enables/disables the button for use

Parameters

bEnable:Boolean

SetHighlighted()method 
public function SetHighlighted(bHighlight:Boolean):void

Enables/disables highlighting the button, as if the mouse was over it. This is used for key controls.

Parameters

bHighlight:Boolean

SetSelected()method 
public function SetSelected(bSelect:Boolean):void

Enables/disables selection of the button. When a button is selected, it cannot be used. This is primarly for buttons that toggle settings.

Parameters

bSelect:Boolean

SetText()method 
override public function SetText(sText:String, tfTextFormat:TextFormat = null):void

Sets the text to display on the button

Parameters

sText:String — Text to display
 
tfTextFormat:TextFormat (default = null) — The text format to use

SetWidth()method 
override public function SetWidth(iWidth:int):void

Sets the width of the button

Parameters

iWidth:int

Up()method 
protected function Up():void

Constant Detail
STATE_DISABLEDConstant
public const STATE_DISABLED:int = 4

STATE_DOWNConstant 
public const STATE_DOWN:int = 3

STATE_OUTConstant 
public const STATE_OUT:int = 1

STATE_OVERConstant 
public const STATE_OVER:int = 2

STATE_SELECTEDConstant 
public const STATE_SELECTED:int = 5

STATE_UPConstant 
public const STATE_UP:int = 0