User Guide
Button._focusrect 137
Button._focusrect
Availability
Flash Player 6.
Usage
my_btn._focusrect:Boolean
Description
Property; 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.
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.