Selection.getFocus()

Availability

Flash Player 5. Instance names for buttons and text fields work in Flash Player 6 and later.

Usage

Selection.getFocus()

Parameters

None.

Returns

A string or null.

Description

Method; returns the variable name of the text field that has focus. If no text field has focus, the method returns null. If the current focus is a button, and the button is a Button object, getFocus() returns the target path as a string. If the current focus is a text field, and the text field is a TextField object, getFocus() returns the target path as a string.

If a button movie clip is the currently focused button, Selection.getFocus() returns the target path of the button movie clip. If a Text Field with an instance name is currently focused, Selection.getFocus() returns the target path of the TextField object. Otherwise, it returns the Text Field's variable name.