1 Reply Latest reply on Aug 19, 2007 5:19 AM by Newsgroup_User

    Text User Entry Query

    jackowacko9
      Can anyone see what is wrong with this script.
      What i'm trying to do is take what a user enters in a text box, check it against the correct answer and if it's right play a sound or wrong play a different sound.
      Thanks

        • 1. Re: Text User Entry Query
          Level 7
          No but I can see what's wrong with multiple posts

          "jackowacko9" <webforumsuser@macromedia.com> wrote in message
          news:fa7i92$f1m$1@forums.macromedia.com...
          > Can anyone see what is wrong with this script.
          > What i'm trying to do is take what a user enters in a text box, check it
          > against the correct answer and if it's right play a sound or wrong play a
          > different sound.
          > Thanks
          >
          >
          >
          > --function that checks if what the user enters is right or wrong
          >
          > global user_entry --variable for what user entered
          > global cup --= "la tasse"--variable for correct answer of text input box
          >
          > on keyDown
          >
          > cup = "latasse"-- am i assigning the variable a string value correctly?
          > -- and is it positioned correctly i.e. after the if or where?
          >
          > if( keyPressed(ENTER) ) OR ( keyPressed() = RETURN ) then --i've tried
          > loads
          > --of combinations. I think theres a problem with the keyPressed() method
          > --and also with the RETURN keyword??
          >
          > user_entry = member("la_tasse_input").text --the text of field
          > "la_tasse_input"
          > --is this positioned correctly?
          >
          > if (user_entry = cup) then
          > puppetSound 5, member "vrai" --play correct sound
          > else if (user_entry <> cup ) then --if wrong text is entered
          > puppetSound 6, member "faux" --play false sound
          > end if
          >
          > end if
          >
          > end
          >