Search enginge help

hi… i want a text field that search for labels in the timeline, and in the different labels there a diffrent object i wanted to be shown when the right word is being searched… but i can’t get this script work… the search field only finds the second last and the error label…

[size=1]// assume search txt box is named “searchBox”
// assume search submit button is “searchSubmit”
// labelArray is the array that holds all your frame labels
labelArray = new Array();
labelArray[0] = “one”;
labelArray[1] = “two”;
// fill in the rest…
searchSubmit.onRelease = function() {
if (searchBox != “”:wink: {
var searchString = searchBox.text;
for(var i=0; i< labelArray.length; i++) {
if (searchString == labelArray[ i]) {
//trace("going to " add searchString);
_root.gotoAndPlay(searchString);
} else {
//trace(“whoops, no such label”;);
_root.gotoAndPlay(“error”;);
// error is your label for the error notice
}
}
} else {
searchBox.text = “Enter text”;
}
}
// [/size]