Enabled (Button.enabled Property) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Example
The following code sets the
user clicks the button. First, add a Button instance on the Stage. Second, give it an instance
name of myBtn_btn. Lastly, with frame 1 selected, place the following code into the Actions
panel:
myBtn_btn.onRelease = function(){
this._alpha = 50;
};
See also
_alpha (MovieClip._alpha property)

enabled (Button.enabled property)

public enabled :
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
true
example, 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.
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example demonstrates how you can disable and enable buttons from being
clicked. Two buttons,
ActionScript is added so that the
instances on the Stage. Second, give them instance names of
Lastly, 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 );
};
property of a button named myBtn_btn to 50% when the
_alpha
Boolean
), the button is visible but cannot be clicked. The default
false
and
myBtn1_btn
myBtn2_btn,
myBtn2_btn
,
_alpha (TextField._alpha property)
are on the Stage and the following
button cannot be clicked. First, add two button
myBtn1_btn
and
.
myBtn2_btn
Button
275

Advertisement

Table of Contents
loading

Table of Contents