My ‘Flex’ible Experiments

Highlight Text in TextArea

with one comment

SetSelection method of the TextArea is ued here to highlight the text. This method will work only if the TextArea has the focus or the “alwaysShowSelection” property of the TextArea’s textField is set to true. Since the textField is a private property, we need to extend the TextArea class and set the property inside the class.

This method is highlighting only one search term at a time. Regular expression can be used to highlight multiple matching terms

Click here or on the image to view the example . Right click to view the source

 

Written by subeesh

October 22, 2008 at 7:21 pm

One Response

Subscribe to comments with RSS.

  1. great….! this is almost same what I had been looking for. Code, too, seems simple.

    Harit

    October 30, 2008 at 6:55 am


Leave a Reply