listerner and their share in textfields
Hi, I have a problem with the following code:
function colorText() {
this.background = true;
this.backgroundColor = 0x0000FF;
}
color = new Object();
color.onChanged = colorText;
name.addListener(color);
surname.addListener(color);
name and surname are two input textfield. I'd like to change the background color of the textfields when the text change, but it doesn't work because "this" in the function is not interpreted correctly. If I try to change "this" with for example with name the code works, so the problem is that "this". How can i share the listener for more textfield?
regards Cibernow