View comments | RSS feed

_focusrect property

_focusrect = Boolean;

Specifies whether a yellow rectangle appears around the button or movie clip that has keyboard focus. If _focusrect is set to its default value of true, then a yellow rectangle appears around the currently focused button or movie clip as the user presses the Tab key to navigate through objects in a SWF file. Specify false if you do not want to show the yellow rectangle. This is a global property that can be overridden for specific instances.

If the global _focusrect property is set to false, then the default behavior for all buttons and movieclips is that keyboard navigation 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. To restore full keyboard functionality for a specific button or movieclip, you can override this global property using either Button._focusrect or MovieClip._focusrect.

Note: If you use a component, then FocusManager overrides Flash Player's focus handling, including use of this global property.

Availability: ActionScript 1.0; Flash Player 4

Example

The following example demonstrates how to hide the yellow rectangle around any instances in a SWF file when they have focus in a browser window. Create some buttons or movie clips and add the following ActionScript in frame 1 of the Timeline:

_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. Pressing Enter or the Space key when _focusrect is disabled does not invoke the onRelease event handler as it does when _focusrectis enabled or true.

See also

_focusrect (Button._focusrect property), _focusrect (MovieClip._focusrect property)


Version 8

Comments


No screen name said on Nov 29, 2005 at 3:13 AM :
This does not seem to work for textfields

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00001785.html