A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Recognizing input text

  1. #1
    Member
    Join Date
    May 2002
    Posts
    54
    how do you recognize the input that a user puts in an input textbox? I just need something simple like
    __________________________________________________ __________
    if(the string entered is correct)
    {
    gotoAndPlay(2);
    }
    else{
    gotoAndPlay(4);
    }
    __________________________________________________ __________

  2. #2
    Member
    Join Date
    Sep 2001
    Location
    Málaga, Spain
    Posts
    98
    very simple. ur text field must have name which u enter in the "var" field in the text options panel. for example u can name it "mytext"
    then the code would be as follow:

    if (mytext=="hello") {
    gotoAndPlay(3);
    } else {
    gotoAndPlay(7);
    }
    which means that if the text entered in the input text is "hello", then it would go to frame 3, else it would go to frame 7

  3. #3
    Senior Member
    Join Date
    Jun 2001
    Posts
    2,943
    You need an event of some kind to assign the text box contents to the variable name associated with it.

    Make sure the movie has a stop() action in the frame where the input box is, then use either a button or a keypress event (the enter button, maybe?) to move the movie to the next frame. You could also use a clip event, I guess.

    You should find that the variable contains the input text value from then on.

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