View Full Version : How to Search Textbox with lots of information in it
ingensystems
10-28-2004, 04:45 PM
Does anyone have any script to search a textbox for certain text?
Please let me know.
Thanks,
Shawn
hangalot
10-28-2004, 05:13 PM
easy. if it is a perfect match do a split on the string. if the arrays length is 1 it was not found, else it containes the text
mmm..pi..3.14..
10-28-2004, 07:27 PM
This is a bit more complicated but is very cool. You need 2 text boxes, one multiline dynamic text box (instance name of "TextBox"), and one input field (instance name of "FindText") Also add a button to the stage with the instance name "FindBtn"
Then add this script to your frame:
_root.FindBtn.onRelease = function() {
var TextToFind = TextBox.text.indexOf(FindText.text)
Selection.setFocus("_root.TextBox")
Selection.setSelection(TextToFind, TextToFind+FindText.text.length)
}
This will highlight the text that was in the FindText box inside the TextBox, so type something in the TextBox, like:
this will find text and highlight it inside the text box when you press the button =)
Then in the FindText box type:
highlight it inside
and then press the button, the string you want to find will be highlighted
Eric :)
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.