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

  • Home
  • SEARCH
  • 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 have been using custom swc based components for my new flash game. I
I am new to Flash and AS3. I have a DataGrid like this Item
Sorry, I'm new to flash I have this line of code: BaseEntry( _entryList[i] ).topTeamName
I'm new to the whole Action Script / Flash world...but trying to teach myself
I have a code as below import flash.media.Sound; import flash.media.SoundChannel; flash.system.Security.allowDomain(*); var request:URLRequest =
I have a simple question,in the below example when i created a new TransitionManager
I am completely new to flash. We need to load a binary file from
I'm very new to flash. I'm trying to show a simple button for my
I'm very new to flash and actionscript 3. I've been reading a lot about
im really new to flash, how do i go about creating a variable which

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.