Button.enabled - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Button.enabled

Availability
Flash Player 6.
Usage
my_btn.enabled:Boolean
Description
Property; a Boolean value that specifies whether a button is enabled. When a button is disabled
(the enabled property is set to
value is
. This property is useful if you want to disable part of your navigation; for example,
true
you may want to disable a button in the currently displayed page so that it can't be clicked and the
page cannot be reloaded.
Example
The following example demonstrates how you can disable and enable buttons from being clicked.
Two buttons,
myBtn1_btn
added so that the
// add two button instances on the Stage
// give them instance names of myBtn1_btn and myBtn2_btn
// place the following code on frame 1
// to enable or disable buttons
myBtn1_btn.enabled = true;
myBtn2_btn.enabled = false;
//button code
// the following function will not get called
// because myBtn2_btn.enabled was set to false
myBtn1_btn.onRelease = function() {
trace( "you clicked : " + this._name );
};
myBtn2_btn.onRelease = function() {
trace( "you clicked : " + this._name );
};
136
Chapter 2: ActionScript Language Reference
), the button is visible but cannot be clicked. The default
false
and
myBtn2_btn,
button cannot be clicked:
myBtn2_btn
are on the Stage and the following ActionScript is

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents