Identifying individual values in a text box using Flash
Posted
by
Jamash1989
on Stack Overflow
See other posts from Stack Overflow
or by Jamash1989
Published on 2011-01-15T18:00:57Z
Indexed on
2011/01/15
18:53 UTC
Read the original article
Hit count: 234
I want to identify specific strings in a text box from user input to add to a score variable, like so -
if (userWords.text == firstWord) { score = score + 1; }
The example given adds 1 to the score, but if a user adds a space then a second word the text box views it as a whole and not individual words, resulting in no values added to the score variable.
The problem lies with the whole text box being viewed as one entire string. Instead, I want to split it up so word1 will add 1 to the score, word2 will add 1 to the score, etc.
I am ultra confused with this problem, so thank you to anyone that may help.
© Stack Overflow or respective owner