LFocusEvent Class
An object dispatches a LFocusEvent object when the user changes the focus from one object in the display list to another.
Constructor
LFocusEvent
()
public
Example:
LInit(50, "legend", 800, 480, main);
function main () {
LGlobal.setDebug(true);
var theTextField1 = new LTextField();
theTextField1.x = 20;
theTextField1.y = 20;
theTextField1.setType(LTextFieldType.INPUT);
addChild(theTextField1);
theTextField1.addEventListener(LFocusEvent.FOCUS_IN, onfocus);
theTextField1.addEventListener(LFocusEvent.FOCUS_OUT, outfocus);
var theTextField2 = new LTextField();
theTextField2.x = 20;
theTextField2.y = 100;
theTextField2.setType(LTextFieldType.INPUT);
addChild(theTextField2);
theTextField2.addEventListener(LFocusEvent.FOCUS_IN, onfocus);
theTextField2.addEventListener(LFocusEvent.FOCUS_OUT, outfocus);
}
function onfocus(e){
trace(e.currentTarget + "(" + e.currentTarget.objectIndex + ") FOCUS_IN");
}
function outfocus(e){
trace(e.currentTarget + "(" + e.currentTarget.objectIndex + ") FOCUS_OUT");
}
Properties
FOCUS_IN
String
public
static
[static] Defines the value of the type property of a focusIn event object.(It is only supported by the LTextField object)
This event has the following properties:
Property | Value |
---|---|
currentTarget | The object that is actively processing the Event object with an event listener. |
target | In this Event, Equivalent to currentTarget. |
FOCUS_OUT
String
public
static
[static] Defines the value of the type property of a focusOut event object.(It is only supported by the LTextField object)
This event has the following properties:
Property | Value |
---|---|
currentTarget | The object that is actively processing the Event object with an event listener. |
target | In this Event, Equivalent to currentTarget. |