User Guide
FocusManager class 425
Usage
focusManager.defaultPushButton
Description
Property; specifies the default push button for an application. When the user presses Enter
(Windows) or Return (Macintosh), the listeners of the default push button receive a
click event.
The default value is
undefined and the data type of this property is object.
The Focus Manager uses the emphasized style declaration of the SimpleButton class to visually
indicate the current default push button.
The value of the
defaultPushButton property is always the button that has focus. Setting the
defaultPushButton property does not give initial focus to the default push button. If there are
several buttons in an application, the button that currently has focus receives the
click event
when Enter or Return is pressed. If some other component has focus when Enter or Return is
pressed, the
defaultPushButton property is reset to its original value.
Example
The following code sets the default push button to the OKButton instance:
focusManager.defaultPushButton = OKButton;
See also
FocusManager.defaultPushButtonEnabled
,
FocusManager.sendDefaultPushButtonEvent()
FocusManager.defaultPushButtonEnabled
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
focusManager.defaultPushButtonEnabled
Description
Property; a Boolean value that determines if keyboard handling of the default push button is
turned on (
true) or not (false). Setting defaultPushButtonEnabled to false allows a
component to receive the Return or Enter key and handle it internally. You must re-enable default
push button handling by watching the component’s
onKillFocus() method (see
MovieClip.onKillFocus in Flash ActionScript Language Reference) or focusOut event. The
default value is
true.
This property is for use by advanced component developers.