hi there, i was doing a little search engine in flash mx, but it have some problems.
i load the content of a text file, there is a lot of names, and some data too, and i have to search a name for example, ok, when i first search a name, ok, i use the Selection.setSelection to highlight the name or whatever i search, but after the first time i search, i don’t search anymore!!! what’s the matter of this thing?
well let me show you guys the script:
on(release){
result = _root.textos.htmlText.indexOf(texto_pesquisa.text);
if(texto_pesquisa.text != “” && result >= 0){
Selection.setFocus(_root.textos);
Selection.setSelection(result, result + texto_pesquisa.text.length);
}else{
texto_pesquisa.text = “Nome inexistente…”;
}
}
this script is attached to a button, within the “pesquisa” MC, wich is in the _root of the movie.
ok, i’ll try something like that, but, i don’t see why is wrong, all the search dependes on what is on the text field:
result = _root.textos.htmlText.indexOf(texto_pesquisa.text);
every time i release the button, it takes the value and then do the search. And why when i first search and return the correct result, why the word didn’t highlight? (Selection.setSelection(result, result + texto_pesquisa.text.length) ???
thanks for the help, i tought doing diferent but not get there it…