LTextEvent Class
An object dispatches a LTextEvent object when a user enters text in a text field or clicks a hyperlink in an HTML-enabled text field. There are two types of text events: LTextEvent.TEXT_INPUT and TextEvent.WIND_COMPLETE.
Constructor
LTextEvent
()
public
Item Index
Properties
- TEXT_INPUT static
- WIND_COMPLETE static
Properties
TEXT_INPUT
String
public
static
[static] Defines the value of the type property of a textInput event 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. |
eventType | The type of the event. |
keyCode | Returns the Unicode value of a non-character key in the keyboard event. |
preventDefault() | To cancel the event if it is cancelable |
Example:
LInit(50, "legend", 800, 480, main);
function main () {
LGlobal.setDebug(true);
var theTextField = new LTextField();
theTextField.x = 20;
theTextField.y = 20;
theTextField.setType(LTextFieldType.INPUT);
addChild(theTextField);
theTextField.addEventListener(LTextEvent.TEXT_INPUT, textinput);
}
function textinput(event){
trace("event.keyCode=" + event.keyCode);
}
WIND_COMPLETE
String
public
static
[static] Defines the value of the type property of a textInput event 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. |
Example:
LInit(50, "legend", 800, 480, main);
function main () {
LGlobal.setDebug(true);
var theTextField = new LTextField();
theTextField.x = 20;
theTextField.y = 20;
addChild(theTextField);
theTextField.text = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
theTextField.speed = 2;
theTextField.addEventListener(LTextEvent.WIND_COMPLETE, windComplete);
theTextField.wind();
}
function windComplete(event){
trace("windComplete","event.currentTarget = " + event.currentTarget);
}