richie
November 7th, 2002, 08:22 AM
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.
does anyone see what's wrong?
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.
does anyone see what's wrong?