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

How to make an input text for user to type name in?

New Here ,
Sep 11, 2013 Sep 11, 2013

I'm making a game in which the user can type their name, and later in the game it'll say something like:

"Oh, Kaitlyn, how was your day?" But all I really know how to do is make it so the name will appear but NOT be in an actually sentence. The problem with that is the spacing and punctuation. I tried following a tutorial which gave me this to put in the actionscript for the output box:

output_txt.text = "Hello "+myText+"!";

Here's the tutorial:

http://www.danfergusdesign.com/classfiles/oldClasses/VCB331-richMedia1/exercises/inputOutputText.php

I think it's because it's for as3 that it doesn't work, but I'm kinda new to flash and it doesn't seem too difficult. Please give very discriptive instructions.

TOPICS
ActionScript
569
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

LEGEND , Sep 11, 2013 Sep 11, 2013

What you show will work in AS2 as well as AS3.  Have you assigned an instance name to the textfield (it shows as ' output_txt ' in your example)?  Instance names are assigned by selecting the object on the stage and entering the name in the Properties panel.

You need to store the name that the user enters into a variable.  This can be done a couple different ways.  Do you have something in place for that?

Translate
LEGEND ,
Sep 11, 2013 Sep 11, 2013
LATEST

What you show will work in AS2 as well as AS3.  Have you assigned an instance name to the textfield (it shows as ' output_txt ' in your example)?  Instance names are assigned by selecting the object on the stage and entering the name in the Properties panel.

You need to store the name that the user enters into a variable.  This can be done a couple different ways.  Do you have something in place for that?

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