public static getFocus() : String
Returns a string specifying the target path of the object that has focus.
String - A string or null.
The following example creates a text field to output the path of the currently focused object. It then uses an interval function to periodically update the field. To test this, add several button instances to the stage with different instance names, and then add the following ActionScript to your AS or FLA file.
this.createTextField("status_txt", this.getNextHighestDepth(), 0, 0, 150, 25);
function FocusUpdate()
{
s = Selection.getFocus();
if ( s )
{
status_txt.text = s;
}
}
setInterval( FocusUpdate, 100 );
onSetFocus (Selection.onSetFocus event listener), setFocus (Selection.setFocus method)