Packageefnx.gui
Classpublic class Button
InheritanceButton Inheritance flash.display.Sprite

Button is a simple button with three images and four actions: over, down, up and out.



Public Properties
 PropertyDefined by
  down : BitmapData
The BitmapData object to represent the button in the down position.
Button
  downFunction : Function
Reference to the function to be performed on mouse down.
Button
  guide : BitmapData
A BitmapData object specifying the bounds of the button.
Button
  height : Number
Button
  initialized : Boolean
[read-only] Returns whether or not the Button is initialized and contains references to bitmapData.
Button
  outFunction : Function
Reference to the function to be performed on roll out.
Button
  over : BitmapData
The BitmapData object to represent the button in the over position.
Button
  overFunction : Function
Reference to the function to be performed on roll over.
Button
  testing : Boolean = false
[static] Toggles verbose output.
Button
  up : BitmapData
The BitmapData object to represent the button in the normal or "up" position.
Button
  upFunction : Function
Reference to the function to be performed on mouse up.
Button
  width : Number
Button
Public Methods
 MethodDefined by
  
Button
  
Returns a clone of the given Button instance.
Button
  
destroy():void
Destroys all internal references.
Button
  
inheritSkin(parent:Button, inheritFunctions:Boolean = false):void
Inherits the skin [or bitmapdata and guide] as well as optionally the action functions of the parent Button.
Button
Property detail
downproperty
down:BitmapData  [read-write]

The BitmapData object to represent the button in the down position.

Implementation
    public function get down():BitmapData
    public function set down(value:BitmapData):void
downFunctionproperty 
public var downFunction:Function

Reference to the function to be performed on mouse down.

guideproperty 
public var guide:BitmapData

A BitmapData object specifying the bounds of the button. Two BitmapData given for each up/over/down state could be different sizes, so the guide will be the deciding bound.

heightproperty 
height:Number  [read-write]

Implementation
    public function get height():Number
    public function set height(value:Number):void
initializedproperty 
initialized:Boolean  [read-only]

Returns whether or not the Button is initialized and contains references to bitmapData.

Implementation
    public function get initialized():Boolean
outFunctionproperty 
public var outFunction:Function

Reference to the function to be performed on roll out.

overproperty 
over:BitmapData  [read-write]

The BitmapData object to represent the button in the over position.

Implementation
    public function get over():BitmapData
    public function set over(value:BitmapData):void
overFunctionproperty 
public var overFunction:Function

Reference to the function to be performed on roll over.

testingproperty 
public static var testing:Boolean = false

Toggles verbose output.

upproperty 
up:BitmapData  [read-write]

The BitmapData object to represent the button in the normal or "up" position.

Implementation
    public function get up():BitmapData
    public function set up(value:BitmapData):void
upFunctionproperty 
public var upFunction:Function

Reference to the function to be performed on mouse up.

widthproperty 
width:Number  [read-write]

Implementation
    public function get width():Number
    public function set width(value:Number):void
Constructor detail
Button()constructor
public function Button()

Method detail
clone()method
public function clone():Button

Returns a clone of the given Button instance.

Returns
Button — Button instance.
destroy()method 
public function destroy():void

Destroys all internal references.

inheritSkin()method 
public function inheritSkin(parent:Button, inheritFunctions:Boolean = false):void

Inherits the skin [or bitmapdata and guide] as well as optionally the action functions of the parent Button. This is much like the clone function, but instead of creating a new Button instance and returning it, it populates the calling Button instance with the bitmapdata and guide of the Button passed in the parameters.

Parameters
parent:Button — The parent Button to inherit from.
 
inheritFunctions:Boolean (default = false)