Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Display text input on another frame

New Here ,
Jan 11, 2013 Jan 11, 2013

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

TOPICS
ActionScript
2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 11, 2013 Jan 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;

}

Translate
Community Expert ,
Jan 11, 2013 Jan 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 11, 2013 Jan 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 11, 2013 Jan 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;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 11, 2013 Jan 11, 2013

Okay. Then what code would I use to make that textput display in a dynamic field on another frame?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 11, 2013 Jan 11, 2013

:

dynamic_tf.text=inputTextString;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 11, 2013 Jan 11, 2013

THANKS SO MUCH!!!!!

IT WORKED!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 11, 2013 Jan 11, 2013

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2013 Feb 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2013 Feb 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2013 Feb 28, 2013
LATEST

I didn't respond because the file I had with this code on it was deleted. I'm sorry.

Starting another discussion would be easier. But I have another file similar to the previous one. I can see if I can put the code on it, if you are willing to wait a day or two.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines