User Guide
1346 UIComponent class
Example
The following code disables a Button component, btn, while a user types the TextInput
component,
txt, and enables the button when the user clicks it:
var txt:mx.controls.TextInput;
var btn:mx.controls.Button;
var txtListener:Object = new Object();
txtListener.focusOut = function() {
_root.btn.enabled = true;
}
txt.addEventListener("focusOut", txtListener);
var txtListener2:Object = new Object();
txtListener2.focusIn = function() {
_root.btn.enabled = false;
}
txt.addEventListener("focusIn", txtListener2);
See also
EventDispatcher.addEventListener(), UIComponent.focusIn
UIComponent.getFocus()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
componentInstance.getFocus();
Parameters
None.
Returns
A reference to the object that currently has focus.
Description
Method; returns a reference to the object that has keyboard focus.