Reputation: 9
When I type in the textfield I want an event listener to start. But I only want it so when you start typing, not when you click on it. Im not too sure how to go about this. What do I do?
Upvotes: 0
Views: 446
Reputation: 8159
var tf:TextField = new TextField();
tf.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
function keyUpHandler(e:KeyboardEvent):void {
// do something
}
If you need to know what character was typed, look at KeyboardEvent.keyCode
Upvotes: 0
Reputation: 39466
TextField
s dispatch two events which would be helpful for achieving that:
Event.CHANGE
KeyboardEvent.KEY_UP
Upvotes: 3