Skip to main content
Known Participant
Jan 11, 2013 3:40 PM UTC
Answered

Display text input on another frame

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.
kglad
kgladCorrect answer
Community Expert
Jan 11, 2013 4:07 PM UTC

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
Feb 28, 2013 11:36 AM UTC

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

Translate
kglad
Community Expert
Community Expert
Feb 28, 2013 4:05 PM UTC

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

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

Translate
kglad
Community Expert
Community Expert
Jan 11, 2013 3:44 PM UTC

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.

Translate
qwerty245Author
Known Participant
Jan 11, 2013 3:57 PM UTC

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?

Translate
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
Jan 11, 2013 4:07 PM UTC

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;

}

Translate