A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Input Text

  1. #1
    Registered User
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    28

    Input Text

    Simple question for most, but the technical challenged……me.

    Already spent over an hour looking for an answer.

    I have an input text box.
    It’s instance name is “level_txt”
    How do I get the value that is in the text box ?

    button1.onPress = function() {

    trace ("the value in the input box is “ + level_txt.text); //?????? does not work
    }


    thanks
    Mal

  2. #2
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    You probably need to modify the path to the text field...in the code above, the button will be looking for the level_txt textfield inside button1...
    Try:
    code:

    button1.onPress = function() {
    trace ("the value in the input box is “ + _root.level_txt.text);
    }



    K.

  3. #3
    Registered User
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    28
    Thanks K
    but that did not work.
    Obviously I am doing something wrong in my codeing.
    I must have my code in the wrong place.

    I would appreciate if you would look at it.

    It’s frustrating, as I know how to code in VB but I am totally lost in flash.
    I guess there is no substitute for experience and that takes time.


    mal
    Attached Files Attached Files

  4. #4
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    Your current code has:
    code:

    button1.onPress = function() {
    trace ("here I am " + _root.Level_txt);
    }



    Change it to:
    code:

    button1.onPress = function() {
    trace ("here I am " + _root.Level_txt.text);
    }



    Also, note that Flash is case-sensitive - so level_txt is not the same as Level_txt...

    K.

  5. #5
    Registered User
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    28
    Thanks K

    didn't know about the case-sensitive thing as well.

    mal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center