Flash ActionScript 2.0 question about Arrays and input text fields.
I’m using an input text field (instance name: inputText)for a Search in a Flash virtual tour.
The user types in a keyword and clicks on a Search button. In the Search button, I have an ‘if’ statement that reads:
If (inputText == “thekeywordtext”){
Run this function ();
}
So, for example if I want the user to run a particular function if they type in ‘dsx1’, I’m thinking they could also type in dsx-1, dsx, digital cross connect, x-connect etc.
Can I use an array with these variations for searching and then in my if statement reference the array?
So:
var myArray:Array = new Array();
myArray[0] = "dsx";
myArray[1] = "dsx1";
myArray[2] = "dsx-1";
myArray[3] = "digital signal cross-connect";
If (inputText == myArray){
Run this function();
}
Thanks.