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.
"jackowacko9" <firstname.lastname@example.org> wrote in
> 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.
> --function that checks if what the user enters is right
> 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
> -- and is it positioned correctly i.e. after the if or
> if( keyPressed(ENTER) ) OR ( keyPressed() = RETURN )
then --i've tried
> --of combinations. I think theres a problem with the
> --and also with the RETURN keyword??
> user_entry = member("la_tasse_input").text --the text of
> --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
> puppetSound 6, member "faux" --play false sound
> end if
> end if