User Guide

Button 357
_focusrect (Button._focusrect property)
public _focusrect : Boolean
A Boolean value that specifies whether a button has a yellow rectangle around it when it has
keyboard focus. This property can override the global
_focusrect property. By default, the
_focusrect property of a button instance is null; meaning, the button instance does not
override the global
_focusrect property. If the _focusrect property of a button instance is
set to
true or false, it overrides the setting of the global _focusrect property for the single
button instance.
In Flash Player 4 or Flash Player 5 SWF files, the
_focusrect property controls the global
_focusrect property. It is a Boolean value. This behavior was changed in Flash Player 6 and
later to permit customizing the
_focusrect property on an individual movie clip.
If the
_focusrect property is set to false, then keyboard navigation for that button is
limited to the Tab key. All other keys, including the Enter and arrow keys, are ignored. To
restore full keyboard navigation, you must set
_focusrect to true.
Availability: ActionScript 1.0; Flash Player 6
Example
This example demonstrates how to hide the yellow rectangle around a specified button
instance in a SWF file when it has focus in a browser window. Create three buttons called
myBtn1_btn, myBtn2_btn, and myBtn3_btn, and add the following ActionScript to Frame 1
of the Timeline:
myBtn2_btn._focusrect = false;
Change the publish settings to Flash Player 6, and test the SWF file in a browser window by
selecting File > Publish Preview > HTML. Give the SWF focus by clicking it in the browser
window, and use the Tab key to focus each instance. You will not be able to execute code for
this button by pressing Enter or the Space key when
_focusrect is disabled.
getDepth (Button.getDepth method)
public getDepth() : Number
Returns the depth of the button instance.
Each movie clip, button, and text field has a unique depth associated with it that determines
how the object appears in front of or in back of other objects. Objects with higher depths
appear in front.
Availability: ActionScript 1.0; Flash Player 6