Package com.bit101.components
Class public class PushButton
Inheritance PushButton InheritanceComponent Inheritance flash.display.Sprite



Public Properties
  Property Defined By
  Inherited enabled : Boolean
Sets/gets whether this component is enabled or not.
Component
  Inherited height : Number
[override] Sets/gets the height of the component.
Component
    label : String
Sets / gets the label text shown on this Pushbutton.
PushButton
    selected : Boolean
PushButton
  Inherited tag : int
Sets/gets in integer that can identify the component.
Component
    toggle : Boolean
PushButton
  Inherited width : Number
[override] Sets/gets the width of the component.
Component
  Inherited x : Number
[override] [write-only] Overrides the setter for x to always place the component on a whole pixel.
Component
  Inherited y : Number
[override] [write-only] Overrides the setter for y to always place the component on a whole pixel.
Component
Protected Properties
  Property Defined By
    _back : Sprite
PushButton
    _down : Boolean = false
PushButton
  Inherited _enabled : Boolean = true
Component
    _face : Sprite
PushButton
  Inherited _height : Number = 0
Component
    _label : Label
PushButton
    _labelText : String
PushButton
    _over : Boolean = false
PushButton
  Inherited Ronda : Class
Component
    _selected : Boolean = false
PushButton
  Inherited _tag : int = -1
Component
    _toggle : Boolean = false
PushButton
  Inherited _width : Number = 0
Component
Public Methods
  Method Defined By
   
PushButton(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, label:String, defaultHandler:Function = null)
Constructor
PushButton
   
draw():void
[override] Draws the visual ui of the component.
PushButton
  Inherited
initStage(stage:Stage):void
[static] Utility method to set up usual stage align and scaling.
Component
  Inherited
move(xpos:Number, ypos:Number):void
Moves the component to the specified position.
Component
  Inherited
setSize(w:Number, h:Number):void
Sets the size of the component.
Component
Protected Methods
  Method Defined By
   
addChildren():void
[override] Creates and adds the child display objects of this component.
PushButton
  Inherited
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
Component
   
init():void
[override] Initializes the component.
PushButton
  Inherited
invalidate():void
Marks the component to be redrawn on the next frame.
Component
  Inherited
onInvalidate(event:Event):void
Called one frame after invalidate is called.
Component
   
onMouseDown(event:MouseEvent):void
Internal mouseOut handler.
PushButton
   
onMouseOut(event:MouseEvent):void
Internal mouseOut handler.
PushButton
   
onMouseOver(event:MouseEvent):void
Internal mouseOver handler.
PushButton
   
onMouseUp(event:MouseEvent):void
Internal mouseUp handler.
PushButton
Public Constants
  Constant Defined By
  Inherited DRAW : String = draw
[static]
Component
Property Detail
_back property
protected var _back:Sprite

_down property  
protected var _down:Boolean = false

_face property  
protected var _face:Sprite

_label property  
protected var _label:Label

_labelText property  
protected var _labelText:String

_over property  
protected var _over:Boolean = false

_selected property  
protected var _selected:Boolean = false

_toggle property  
protected var _toggle:Boolean = false

label property  
label:String

Sets / gets the label text shown on this Pushbutton.


Implementation
    public function get label():String
    public function set label(value:String):void
selected property  
selected:Boolean


Implementation
    public function get selected():Boolean
    public function set selected(value:Boolean):void
toggle property  
toggle:Boolean


Implementation
    public function get toggle():Boolean
    public function set toggle(value:Boolean):void
Constructor Detail
PushButton () Constructor
public function PushButton(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, label:String, defaultHandler:Function = null)

Constructor

Parameters
parent:DisplayObjectContainer (default = null) — The parent DisplayObjectContainer on which to add this PushButton.
 
xpos:Number (default = 0) — The x position to place this component.
 
ypos:Number (default = 0) — The y position to place this component.
 
label:String — The string to use for the initial label of this component.
 
defaultHandler:Function (default = null) — The event handling function to handle the default event for this component (click in this case).
Method Detail
addChildren () method
override protected function addChildren():void

Creates and adds the child display objects of this component.

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

Draws the visual ui of the component.

init () method  
override protected function init():void

Initializes the component.

onMouseDown () method  
protected function onMouseDown(event:MouseEvent):void

Internal mouseOut handler.

Parameters

event:MouseEvent — The MouseEvent passed by the system.
onMouseOut () method  
protected function onMouseOut(event:MouseEvent):void

Internal mouseOut handler.

Parameters

event:MouseEvent — The MouseEvent passed by the system.
onMouseOver () method  
protected function onMouseOver(event:MouseEvent):void

Internal mouseOver handler.

Parameters

event:MouseEvent — The MouseEvent passed by the system.
onMouseUp () method  
protected function onMouseUp(event:MouseEvent):void

Internal mouseUp handler.

Parameters

event:MouseEvent — The MouseEvent passed by the system.