Skip to main content
Known Participant
January 11, 2013
Answered

Display text input on another frame

  • January 11, 2013
  • 10 replies
  • 2647 views

How can I get the user's input to display in a dynamic field on another frame. I have a text input field and a button that goes to the next frame. When I debug the program, I want the user to enter their custom name and then that name will display in a dynamic text field on multple frames.

I tried multiple methods but the dynamic text field displayed:

.undefined

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer kglad

if your input textfield has instance name input_tf, you can copy and paste the following into the first keyframe that contains input_tf:

var inputTextString:String;

input_tf.onChanged=function(){

inputTextString=this.text;

}

10 replies

Participating Frequently
February 28, 2013

This is exactly what I am trying to do also.  Is it possible to get a screen shot of your action script so i can see this working.  I am still having issues with mine.

Many Thanks

kglad
Community Expert
Community Expert
February 28, 2013

because this thread is so old, the op is not likely to respond.

so, if they fail to respond, start a new thread.

kglad
Community Expert
Community Expert
January 11, 2013

save the text in a variable and use that variable in your other frame:

// after text input is entered (eg, using onChanged handler)

var inputTextString:String = input_tf.text;

// then from any frame on that timeline (after the above code executes), you can use inputTextString to retrieve the text from input_tf even though input_tf may no longer exist.

qwerty245Author
Known Participant
January 11, 2013

So I can just copy this code:

var inputTextString:String = input_tf.text;

and place it into the actionscript for the frame with the inputtext field?

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
January 11, 2013

if your input textfield has instance name input_tf, you can copy and paste the following into the first keyframe that contains input_tf:

var inputTextString:String;

input_tf.onChanged=function(){

inputTextString=this.text;

}