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.
buttonName:String [read-only]Implementation
public function get buttonName():String
enabled:Boolean [read-write]Implementation
public function get enabled():Boolean
public function set enabled(value:Boolean):void
protected var mButtonName:String = ""
protected var mDown:DisplayObject = null
protected var mEnabled:Boolean = true
protected var mOver:DisplayObject = null
protected var mSelected:Boolean = false
protected var mUp:DisplayObject = null
selected:Boolean [read-write]Implementation
public function get selected():Boolean
public function set selected(value:Boolean):void
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.
|
protected function OnAddedToStage(event:Event):voidParameters
protected function OnMouseDown(event:MouseEvent):voidParameters
protected function OnMouseOut(event:MouseEvent):voidParameters
protected function OnMouseOver(event:MouseEvent):voidParameters
protected function OnMouseUp(event:MouseEvent):voidParameters
protected function OnRemovedFromStage(event:Event):voidParameters
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
|