Packageorg.wak.utils
Classpublic class WakSimpleButton
InheritanceWakSimpleButton Inheritance flash.display.Sprite
SubclassesSciItemSelectionButton

This is for replace the use of the built in flash SimpleButton it has some bugs with the custom cursor and mouse over. The cons of this is that it needs to be updated on Mouse move event to update the button state with a Hit Test.



Public Properties
 PropertyDefined by
  buttonName : String
[read-only]
WakSimpleButton
  enabled : Boolean
WakSimpleButton
  selected : Boolean
WakSimpleButton
Protected Properties
 PropertyDefined by
  mButtonName : String = ""
WakSimpleButton
  mDown : DisplayObject = null
WakSimpleButton
  mEnabled : Boolean = true
WakSimpleButton
  mOver : DisplayObject = null
WakSimpleButton
  mSelected : Boolean = false
WakSimpleButton
  mUp : DisplayObject = null
WakSimpleButton
Public Methods
 MethodDefined by
  
WakSimpleButton(pUp:DisplayObject, pOver:DisplayObject, pDown:DisplayObject, pActionName:String = "")
Constructor.
WakSimpleButton
  
Update(pStageX:Number, pStageY:Number):void
Updates the button state using a hitTestPoint over pStageX and pStageY.
WakSimpleButton
Protected Methods
 MethodDefined by
  
OnAddedToStage(event:Event):void
WakSimpleButton
  
OnMouseDown(event:MouseEvent):void
WakSimpleButton
  
OnMouseOut(event:MouseEvent):void
WakSimpleButton
  
OnMouseOver(event:MouseEvent):void
WakSimpleButton
  
OnMouseUp(event:MouseEvent):void
WakSimpleButton
  
OnRemovedFromStage(event:Event):void
WakSimpleButton
Property detail
buttonNameproperty
buttonName:String  [read-only]Implementation
    public function get buttonName():String
enabledproperty 
enabled:Boolean  [read-write]Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
mButtonNameproperty 
protected var mButtonName:String = ""
mDownproperty 
protected var mDown:DisplayObject = null
mEnabledproperty 
protected var mEnabled:Boolean = true
mOverproperty 
protected var mOver:DisplayObject = null
mSelectedproperty 
protected var mSelected:Boolean = false
mUpproperty 
protected var mUp:DisplayObject = null
selectedproperty 
selected:Boolean  [read-write]Implementation
    public function get selected():Boolean
    public function set selected(value:Boolean):void
Constructor detail
WakSimpleButton()constructor
public function WakSimpleButton(pUp:DisplayObject, pOver:DisplayObject, pDown:DisplayObject, pActionName:String = "")

Constructor.

Parameters
pUp:DisplayObject — The initial value for the WakSimpleButton up state.
 
pOver:DisplayObject — The initial value for the WakSimpleButton over state.
 
pDown:DisplayObject — The initial value for the WakSimpleButton down state.
 
pActionName:String (default = "") — an optional button name to use as an id depending on the context.
Method detail
OnAddedToStage()method
protected function OnAddedToStage(event:Event):voidParameters
event:Event
OnMouseDown()method 
protected function OnMouseDown(event:MouseEvent):voidParameters
event:MouseEvent
OnMouseOut()method 
protected function OnMouseOut(event:MouseEvent):voidParameters
event:MouseEvent
OnMouseOver()method 
protected function OnMouseOver(event:MouseEvent):voidParameters
event:MouseEvent
OnMouseUp()method 
protected function OnMouseUp(event:MouseEvent):voidParameters
event:MouseEvent
OnRemovedFromStage()method 
protected function OnRemovedFromStage(event:Event):voidParameters
event:Event
Update()method 
public function Update(pStageX:Number, pStageY:Number):void

Updates the button state using a hitTestPoint over pStageX and pStageY.

Parameters
pStageX:Number — mouse horizontal coordinate on the stage
 
pStageY:Number — mouse vertical coordinate on the stage