1 Reply Latest reply on Apr 28, 2010 10:59 PM by martingr

    how to get user input - text & data???

    martingr Level 1

      Can anyone suggest the best way to "read" user input into variables

      (text and/or numeric) in Director.

       

      I have looked at the Field and Flash TextInput components however the

      help file documentation is quite limited and doesn't give any useful examples.

       

      For example how can a user enter and save their name, address, DOB etc

       

      What if the values also need to be numeric (eg currency) to perform calculations - does

      it need to be converted to a specific data type? 

       

      (My lingo knowledge is ok but I haven't done any user input stuff before)

      Thanks in advance for any help!

        • 1. Re: how to get user input - text & data???
          Sean_Wilson Adobe Community Professional
          I have looked at the Field and Flash TextInput components however the

          help file documentation is quite limited and doesn't give any useful examples.

          If you are using a #field, you grab the text of the member into a variable, like so:

          tVariable = member("field").text

          If it's a Flash Component, you grab the text of the sprite:

          tVariable = sprite(number).text
          

           

          What if the values also need to be numeric (eg currency) to perform calculations - does

          it need to be converted to a specific data type?

          You can convert strings to numbers with either integer(), float() or value():

          tFloat = float( member("field").text )
          tInteger = integer( member("field").text )
          tValue = value( member("field").text )