PDA

View Full Version : textfield help!


izzy44
03-05-2003, 01:34 PM
Right now I have 3 seperate textfields... test1, test2, and test3.

I need for the fourth textfield, test4 to show test1, test2, and test3 seperated by commas and to automatically update when any one of them changes.

I have tried using the addListener and onChanged methods and they didnt seem to work for me but I may have done them wrong. PLEASE HELP ME!

Thanks,
Izzy

simontheak
03-05-2003, 02:38 PM
Total shot in the dark here, but couldn't you have an on(EnterFrame) event that simply joins together the three text fields in to the fourth?

Something like:

on(EnterFrame){
_root.test4.text=_root.test1.text+","+_root.test2.text+","+_root.test3.text
}


I haven't tried this, but it should work. The on(EnterFrame) would give the appearane of the 4 text field being updated as soon as anything changes in any of the 3 other fields

lbower
03-05-2003, 05:51 PM
I think this should work for you.

test1.onChanged = function() {
displayOutput();
}

test2.onChanged = function() {
displayOutput();
}

test3.onChanged = function() {
displayOutput();
}

function displayOutput() {
test4.text = test1.text + ", " + test2.text + ", " + test3.text;
}