1 Reply Latest reply on Sep 11, 2013 5:02 PM by Ned Murphy

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

    Mai-Ni

      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/inputOutp utText.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.

        • 1. Re: How to make an input text for user to type name in?
          Ned Murphy Adobe Community Professional & MVP

          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?