Identifying individual values in a text box using Flash
- by Jamash1989
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.