User Guide

UIComponent class 797
Example
The following code disables a Button component, btn, while a user types in the TextInput
component,
txt, and enables the button when the user click on 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.focusOut
UIComponent.focusOut
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
on(focusOut){
...
}
listenerObject = new Object();
listenerObject.focusOut = function(eventObject){
...
}
componentInstance.addEventListener("focusOut", listenerObject)
Description
Event; notifies listeners that the object has lost keyboard focus.
The first usage example uses an
on() handler and must be attached directly to a
component instance.