Hello everyone,
Once again, I’m having a small problem with an array. I have a btn with this script attached to it :
on (keyPress "<Enter>") {
if (_root.input_txt.text.indexOf(wordArray[1])>=0) {
trace("match");
}
}
And a frame with this :
var wordArray:Array = new Array("hey", "hi", "hello");
Now, as you can probably figure out Flash will trace “match” once the input text (_root.input_txt) contains the letter combination “hi”… my question is whether it would be possible to make it check whether any of the objects in the array are contained within the input text. and if it is possible then how???.
I am trying to make it react (in this case, trace “match”) not only if one specific object from the array is contained in the input text, but when it sees one of the words from wordArray…
I thought that just writing the name of the arry would make Flash check all of the words that the array contains… but it didn’t work I got a syntax error… please help me solve this. :hurt:
Hope I didn’t give you a headache.
Cheers