Packagecom.bit101.components
Classpublic class PushButton
InheritancePushButton Inheritance Component Inheritance flash.display.Sprite



Public Properties
 PropertyDefined By
 Inheritedenabled : Boolean
Sets/gets whether this component is enabled or not.
Component
 Inheritedheight : 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
 Inheritedtag : int
Sets/gets in integer that can identify the component.
Component
  toggle : Boolean
PushButton
 Inheritedwidth : Number
[override] Sets/gets the width of the component.
Component
 Inheritedx : Number
[override] [write-only] Overrides the setter for x to always place the component on a whole pixel.
Component
 Inheritedy : Number
[override] [write-only] Overrides the setter for y to always place the component on a whole pixel.
Component
Protected Properties
 PropertyDefined 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
 InheritedRonda : Class
Component
  _selected : Boolean = false
PushButton
 Inherited_tag : int = -1
Component
  _toggle : Boolean = false
PushButton
 Inherited_width : Number = 0
Component
Public Methods
 MethodDefined 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
 MethodDefined By
  
[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
 ConstantDefined By
 InheritedDRAW : String = draw
[static]
Component
Property Detail
_backproperty
protected var _back:Sprite

_downproperty 
protected var _down:Boolean = false

_faceproperty 
protected var _face:Sprite

_labelproperty 
protected var _label:Label

_labelTextproperty 
protected var _labelText:String

_overproperty 
protected var _over:Boolean = false

_selectedproperty 
protected var _selected:Boolean = false

_toggleproperty 
protected var _toggle:Boolean = false

labelproperty 
label:String

Sets / gets the label text shown on this Pushbutton.


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


Implementation
    public function get selected():Boolean
    public function set selected(value:Boolean):void
toggleproperty 
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.