A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Passing Input Text To Dynamic Text

  1. #1
    Junior Member
    Join Date
    Oct 2000
    Posts
    11

    Passing Input Text To Dynamic Text

    I am not much of an actionscript guy, and I need a little help with something.

    I have two separate text input fields (line1 and line2) that I want to pass their contents to two dynamic text fields (result1 and result2) within the same frame.

    line1 ---> result1
    line2 ---> result2

    I would like to do this so that when you type in the text it updates at the same time as you type).

    Can you help?

  2. #2
    Junior Member
    Join Date
    Oct 2000
    Posts
    11
    Ok I have the input text being passed with:

    result1.text = line1.text;
    Can someone tell me how to have result1 update when line1 is changed? Maybe with onChanged

  3. #3
    :
    Join Date
    Dec 2002
    Posts
    3,518

    Maybe you can adapt this...

    Code:
    line1.onChanged = function(tf_txt:TextField) {
    	result1.text = tf_txt.text;
    };
    line2.onChanged = function(tf_txt:TextField) {
    	result2.text = tf_txt.text;
    };

  4. #4
    Junior Member
    Join Date
    Oct 2000
    Posts
    11
    Thanks dawsonk. I tried that but nothing gets updated.

  5. #5
    :
    Join Date
    Dec 2002
    Posts
    3,518
    What version of Flash & ActionScript are you using?

  6. #6
    Junior Member
    Join Date
    Oct 2000
    Posts
    11
    Actionscript 2

  7. #7
    Junior Member
    Join Date
    Oct 2000
    Posts
    11
    And CS3

  8. #8
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Then, the onChanged should work...
    Where are you placing the code in relationship to the text fields? (pathing problem?)
    Last edited by dawsonk; 06-10-2009 at 10:17 AM.

  9. #9
    Junior Member
    Join Date
    Oct 2000
    Posts
    11
    Very weird. I had mine setup exactly like your sample file and it didn't work. I then copied and pasted your stuff into my file and it worked.

    Thanks

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center