03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

enabled (Button.enabled property)<br />

public enabled : Boolean<br />

A Boolean value that specifies whether a button is enabled. When a button is disabled (the<br />

enabled property is set to false), the button is visible but cannot be clicked. The default<br />

value is true. This property is useful if you want to disable part of your navigation; for<br />

example, you may want to disable a button in the currently displayed page so that it can't be<br />

clicked <strong>and</strong> the page cannot be reloaded.<br />

Example<br />

The following example demonstrates how you can disable <strong>and</strong> enable buttons from being<br />

clicked. Two buttons, myBtn1_btn <strong>and</strong> myBtn2_btn, are on the Stage <strong>and</strong> the following<br />

ActionScript is added so that the myBtn2_btn button cannot be clicked. First, add two button<br />

instances on the Stage. Second, give them instance names of myBtn1_btn <strong>and</strong> myBtn2_btn.<br />

Lastly, place the following code on frame 1 to enable or disable buttons.<br />

myBtn1_btn.enabled = true;<br />

myBtn2_btn.enabled = false;<br />

//button code<br />

// the following function will not get called<br />

// because myBtn2_btn.enabled was set to false<br />

myBtn1_btn.onRelease = function() {<br />

trace( "you clicked : " + this._name );<br />

};<br />

myBtn2_btn.onRelease = function() {<br />

trace( "you clicked : " + this._name );<br />

};<br />

_focusrect (Button._focusrect property)<br />

public _focusrect : Boolean<br />

A Boolean value that specifies whether a button has a yellow rectangle around it when it has<br />

input focus. This property can override the global _focusrect property. By default, the<br />

_focusrect property of a button instance is null; the button instance does not override the<br />

global _focusrect property. If the _focusrect property of a button instance is set to true or<br />

false, it overrides the setting of the global _focusrect property for the single button<br />

instance.<br />

In Flash Player 4 <strong>and</strong> Flash Player 5 SWF files, the _focusrect property controls the global<br />

_focusrect property. It is a Boolean value. This behavior was changed in Flash Player 6 <strong>and</strong><br />

later to permit customizing the _focusrect property on an individual movie clip.<br />

Button 257

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!