PDA

View Full Version : else if for text input problem


Mang
01-27-2009, 02:42 AM
I'm trying to evaluate user input from a textbox using an else if statement.
I understand the concept of else if. The problem is that flash isn't recognizing upper case letters. Is that true?
Here's what I have:
if(_level0.AnswerTxt.text == "i morgen") then...
else if(_level0.AnswerTxt.text == "I morgen")then...

If I enter the uppercase "I" into the text box Flash doesn't appear to recognise it (doesn't execute). I know I have the else if correct. Is there some trick to this?

Thanks,

Mangman

endergrl
01-27-2009, 07:26 PM
try adding .toLowerCase() to it so it would look like _level0.AnswerTxt.text.toLowerCase(); If that isn't working then set a variable = to _level0.AnswerTxt.text, then say myVar = myVar.toLowerCase(), and then use that in the if statement.

Mang
01-27-2009, 09:58 PM
That was it. Thanks.