Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6037683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:06:37+00:00 2026-05-23T06:06:37+00:00

I am new at flash, the below is my script, i have 3 textinput

  • 0

I am new at flash, the below is my script, i have 3 textinput boxes, name1, name2, name3 and 3 dynamic texts, output1, output2, output3. Once the user, enters the text in the box, it should appear exactly the same in the dynamic output text. It works for the first one, but does not work for the second and third one. I renamed changehandlers differently to remove compile errors, but now only the first one works. Is there a better way of doing this, if i want to have multiple textbox entrees?

name1.addEventListener(Event.CHANGE, changeHandler);

function changeHandler(e:Event):void 
{
    output1.text = name1.text

}
name2.addEventListener(Event.CHANGE, changeHandler);

function changeHandler1(e:Event):void 
{
    output2.text = name2.text;
}

name3.addEventListener(Event.CHANGE, changeHandler);

function changeHandler2(e:Event):void 
{
    output3.text = name3.text;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:06:38+00:00Added an answer on May 23, 2026 at 6:06 am

    You forgot to change the name of the listener functions in the latter two addEventListener() calls. It currently calls changeHandler() on all three events.

    You should have:

    name2.addEventListener(Event.CHANGE, changeHandler1);
    name3.addEventListener(Event.CHANGE, changeHandler2);
    

    You can create a class that manages joining the input text field with the output text field:

    package
    {
        import flash.text.TextField;
        import flash.events.Event;
    
        public class TextBinder extends Object
        {
            // vars
            private var _input:TextField;
            private var _output:TextField;
    
            /**
             * Joins input with output
             * @param inp The input text field
             * @param outp The output text field
             */
            public function join(inp:TextField, outp:TextField):void
            {
                _input = inp;
                _output = outp;
    
                _input.addEventListener(Event.CHANGE, _change);
            }
    
            /**
             * Event.CHANGE
             */
            private function _change(e:Event):void
            {
                _output.text = _input.text;
            }
        }
    }
    

    And now you can loop through your text fields and join them using this:

    var tb:TextBinder = new TextBinder();
    tb.join(name1, output1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to the whole Action Script / Flash world...but trying to teach myself
For a new project with Flash I was looking for something along the lines
Make a new AS3 Document in Flash, paste in the following code and run
I have a flash file menu i am having problem while link it to
I have a Drupal view which should output a video player using flash. I
When I deploy a new .swf file in an HTML file as shown below,
I have multiple toggle buttons on my flash stage. These toggle buttons are MovieClips.
I'm following this tutorial on Flash Pro CS4: http://www.baycongroup.com/flashCS4/09_flashCS4.html I have a button. I
I have a new web app that is packaged as a WAR as part
I have found this example on StackOverflow: var people = new List<Person> { new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.