| Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact | |
CustomButton |
|
|
| 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 |
| Method | Defined By |
|---|---|
| All inherited methods of the MovieClip class | N/A |
| 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. Implementationpublic function get label():Stringpublic function set label(value:String):void |
|
_enabled property _enabled:String [read-write] This disables the button with color change. The default value is true. Implementationpublic function get _enabled():Booleanpublic 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");
}
|