Event.CHANGE not doing what I expected.

REOPENED QUESTION:

Well, for some reason I still cannot get it to work.  I have a textbox (tb1) that gets text from an XML dynamically.  I want a different textbox (tb2), in the same swf, to display the same on-the-fly text as tb1.  Below is the code I am using which does not work.

tb1.addEventListener(Event.CHANGE, texter);
function texter(event:Event):void
{
	tb2.text = tb1.text;
}

Open in new window


Any help to fix this would be greatly appreciated.
ModifyMeAsked:
Who is Participating?
 
conagramanCommented:
why not get rid of the change event and in the same function that fills tb2 fill tb1

0
 
tomaugerdotcomCommented:
The reason the event isn't triggering as you would expect depends on how you are changing the text inside tb1. If it's being initially populated, that may not trigger the event.

Does tb2 populate correctly when the user manually types into tb1?
0
 
tomaugerdotcomCommented:
You may need to provide more code, or the source FLA so we can track down the issue.
0
 
ModifyMeAuthor Commented:
I got it to work, the EventListener was on the wrong object...my bad.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.