Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact |

CustomButton

Package:
Class:
Inheritance:
biz.flashscript.components.buttons
public class CustomButton
MovieClip
The CustomButton class is the base class for a custom Button component. To create an instance of the CustomButton component place an instance of the component on the main timeline or call the CustomButton class.
Public Properties
Property Defined By
label :String
Defines the label for the button.
CustomButton
_enabled :Boolean
If false the button will be disabled and the color changes.
CustomButton
Public Methods
Method Defined By
All inherited methods of the MovieClip class N/A
Events
Event Defined By
All inherited events for the MovieClip class. N/A
Property Detail

label property
label:String [read-write]

This defines the text value for the button.

The default value is Button.

Implementation

public function get label():String
public function set label(value:String):void

_enabled property
_enabled:String [read-write]

This disables the button with color change.

The default value is true.

Implementation

public function get _enabled():Boolean
public function set _enabled(value:Boolean):void
Constructor Detail
CustomButton ()  Constructor
public function CustomButton()
To initialize an instance use new CustomButton().
Examples
Create a new fla file and name it CustomButton.fla. Save the file in the same folder where the biz folder is located. Drag an instance of the CustomButton component on stage from the component menu and name it myBut. Add this script and test movie.

myBut.label = "Press Button";
myBut.addEventListener (MouseEvent.CLICK, clickHandler);
function clickHandler (event:MouseEvent):void
{
	trace("I am the button");
}