Event.CHANGE not doing what I expected.

Posted on 2011-04-26
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
    LVL 10

    Accepted Solution

    why not get rid of the change event and in the same function that fills tb2 fill tb1

    LVL 14

    Assisted Solution

    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

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

    Author Closing Comment

    I got it to work, the EventListener was on the wrong bad.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    how can flash builder 4.X version make use of java 8 5 154
    powershel for folder sizes 13 81
    exchange 2007, scripts 15 54
    inactive users 13 36
    Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now