Skip to main content
krish_laugh
Participating Frequently
February 23, 2012
Question

Responding to user text entry not working

  • February 23, 2012
  • 2 replies
  • 428 views

hi,

i want to perform a task when the content of a text field is modified by user input.

i've used onChanged() event handler

following are my code

myTextField.onChanged = function(){

trace("the value has been modified");

}

this code not performing

Please help me in this

This topic has been closed for replies.

2 replies

Ned Murphy
Legend
February 23, 2012

If you happen to be using a TextInput component rather than a TextField object, then you need to manage the listener differently...

var listenerObject:Object = new Object();

listenerObject.change = function(eventObject:Object) {

    trace("textinput changed");

};

myTextInput.addEventListener("change", listenerObject);

Ned Murphy
Legend
February 23, 2012

The code looks fine (and works fine in a quick test).  Make sure you assigned that instance name to the textfield.