Main Page | Packages | Class Tree | Index | Help

com.bjc.controls

class PushButton

MovieClip
  |
  +--com.bjc.core.BJCComponent
        |
        +--com.bjc.core.LabelWrapper
              |
              +--com.bjc.controls.PushButton


class PushButton
extends LabelWrapper

A basic button component.

Events:

click - Fired whenever the user presses and releases the mouse on the button.
releaseOutside - Fired whenever the user presses and releases the mouse outside the button.
rollOver - Fired whenever the mouse moves over the button.
rollOut - Fired whenever the mouse leaves the button.
focus - Fired whenever the component receives focus.
killFocus - Fired whenever the component loses focus.
tabFocus - Fired whenever the component receives focus by pressing the TAB key.


Author:
Flashloaded - www.flashloaded.com


Field Summary

public
addEventListener: Function
See the EventDispatcher Class in Flash Help

public
clickHandler: Function
Can be used to assign a direct event handler to the component instance.

public
focusHandler: Function
Can be used to assign a direct event handler to the component instance.

public
killFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

public
releaseOutsideHandler: Function
Can be used to assign a direct event handler to the component instance.

public
removeEventListener: Function
See the EventDispatcher Class in Flash Help

public
rollOutHandler: Function
Can be used to assign a direct event handler to the component instance.

public
rollOverHandler: Function
Can be used to assign a direct event handler to the component instance.

public
tabFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

Fields inherited from class com.bjc.core.BJCComponent

version

Property Summary

public
align: String (write)
Sets the horizontal alignment of the text in the component. Valid values are "left", "right" and "center".

public
align: String (read)
Gets the horizontal alignment of the text in the component.

public
label: String (write)
Sets the text to be shown on the button.

public
label: String (read)
Gets the text to be shown on the button.

public
margin: Number (write)
Sets the margin for the internal Resizer component

public
margin: Number (read)
Gets the margin for the internal Resizer component

public
selected: Boolean (write)
Sets to set the button's state. Can be used to set the button's state to down, if toggle is set to true.

public
selected: Boolean (read)
Gets the button's state.

public
toggle: Boolean (write)
Determines if button is a simple pushbutton, or a button that can be toggled on and off. If toggle is set to true, the buttons up or down state can be set or retrieved with the PushButton.selected property.

public
toggle: Boolean (read)
Gets the toggle mode of the component.

Properties inherited from class com.bjc.core.LabelWrapper

align, disabledColor, disableStyles, embedFont, fontColor, fontFace, fontSize, html

Properties inherited from class com.bjc.core.BJCComponent

disabledAlpha, enabled, focusTime, height, keyEnabled, style, width

Constructor

public
PushButton ( Void)


Method Summary

public static
create ( target: MovieClip, id: String, depth: Number, initObj: Object ): PushButton
Static method used to create an instance of a PushButton on stage at run time.

Methods inherited from class com.bjc.core.BJCComponent

draw, invalidate, move, remove, setSize



Field Documentation

addEventListener

public var addEventListener: Function
See the EventDispatcher Class in Flash Help

clickHandler

public var clickHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myButton.clickHandler = function(){
trace("I was clicked.");
}

focusHandler

public var focusHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myButton.focusHandler = function(){
trace("Set focus.");
}

killFocusHandler

public var killFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myButton.killFocusHandler = function(){
trace("Kill focus.");
}

releaseOutsideHandler

public var releaseOutsideHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myButton.releaseOutsideHandler = function(){
trace("Release outside.");
}

removeEventListener

public var removeEventListener: Function
See the EventDispatcher Class in Flash Help

rollOutHandler

public var rollOutHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myButton.rollOutHandler = function(){
trace("Roll out.");
}

rollOverHandler

public var rollOverHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myButton.rollOverHandler = function(){
trace("Roll over.");
}

tabFocusHandler

public var tabFocusHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myButton.tabFocusHandler = function(){
trace("Tab focus.");
}


Property Documentation

align

public align: String (write)
Sets the horizontal alignment of the text in the component. Valid values are "left", "right" and "center".

Example:
myButton.align = "center";

align

public align: String (read)
Gets the horizontal alignment of the text in the component.

Example:
myVar = myButton.align;

label

public label: String (write)
Sets the text to be shown on the button.

Example:
myButton.label = "Press me";

label

public label: String (read)
Gets the text to be shown on the button.

Example:
myVar = myButton.label;

margin

public margin: Number (write)
Sets the margin for the internal Resizer component

Example:
myButton.margin = 5;

margin

public margin: Number (read)
Gets the margin for the internal Resizer component

Example:
myVar = myButton.margin;

selected

public selected: Boolean (write)
Sets to set the button's state. Can be used to set the button's state to down, if toggle is set to true.

Example:
myButton.toggle = true;
myButton.selected = true;

See also:

selected

public selected: Boolean (read)
Gets the button's state.

Example:
myVar = myButton.selected;

toggle

public toggle: Boolean (write)
Determines if button is a simple pushbutton, or a button that can be toggled on and off. If toggle is set to true, the buttons up or down state can be set or retrieved with the PushButton.selected property.

Example:
myButton.toggle = true;
myButton.selected = true;

See also:

toggle

public toggle: Boolean (read)
Gets the toggle mode of the component.

Example:
myVar = myButton.toggle;


Constructor Documentation

PushButton

public function PushButton(Void)

Method Documentation

create

public static function create(target: MovieClip,
 id: String,
 depth: Number,
 initObj: Object): PushButton
Static method used to create an instance of a PushButton on stage at run time.

Parameters:
target
the movie clip to which the button will be attached.
id
the instance name given to the new button attached.
depth
the depth at which to attach the new button.
initObj
(optional) an object containing any properties you want to assign to the component when it is created
Returns:
a reference to the new button attached.

Example:
import com.bjc.controls.PushButton;
var newButton:PushButton = PushButton.create(_root, "myButton", 0);


The documentation was generated from the following file:


Copyright Flashloaded - www.flashloaded.com