Event.CHANGE not doing what I expected.

Posted on 2011-04-26
Medium Priority
Last Modified: 2012-05-11

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.
Question by:ModifyMe
  • 2
LVL 10

Accepted Solution

conagraman earned 1000 total points
ID: 35474663
why not get rid of the change event and in the same function that fills tb2 fill tb1

LVL 14

Assisted Solution

tomaugerdotcom earned 1000 total points
ID: 35475206
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?
LVL 14

Expert Comment

ID: 35475207
You may need to provide more code, or the source FLA so we can track down the issue.

Author Closing Comment

ID: 35699486
I got it to work, the EventListener was on the wrong object...my bad.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question