Packageorg.openzet.controls
Classpublic class TextHighlighter
InheritanceTextHighlighter Inheritance flash.events.EventDispatcher

Sets hightlight on TextArea or TextInput controls around search string.

View the examples.



Public Properties
 PropertyDefined by
  searchStr : String
Property to specify the search string.
TextHighlighter
  target : Object
Property to specify the target control.
TextHighlighter
Public Methods
 MethodDefined by
  
Constructor.
TextHighlighter
  
next():void
Highlights the next match of the same search string based on the current seelction index.
TextHighlighter
  
prev():void
Highlights the previous match of the same search string based on the current seelction index.
TextHighlighter
Property detail
searchStrproperty
searchStr:String  [read-write]

Property to specify the search string.

This property can be used as the source for data binding.

Implementation
    public function get searchStr():String
    public function set searchStr(value:String):void
targetproperty 
target:Object  [read-write]

Property to specify the target control. You can only assign controls like TextInput or TextArea for the value of this property.

Implementation
    public function get target():Object
    public function set target(value:Object):void
Constructor detail
TextHighlighter()constructor
public function TextHighlighter()

Constructor.

Method detail
next()method
public function next():void

Highlights the next match of the same search string based on the current seelction index. If no matches are found, hightlights are initialized and search starts from the beginning.

prev()method 
public function prev():void

Highlights the previous match of the same search string based on the current seelction index. If no matches are found, hightlights are initialized and search starts from the end.

Examples
Example_TextHighlight
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute" xmlns:zet="org.openzet.controls.*"
    backgroundColor="0xFFFFFF">
    <zet:TextHighlighter id="high" target="{ta}" findText="{word.text}"/>
    <mx:TextInput id="word" x="10" y="10" text="as" fontSize="12"/>
    <mx:Button x="178" y="10" label="Prev" fontSize="12" click="high.prev()"/>
    <mx:Button x="238" y="10" label="Next" fontSize="12" click="high.next()"/>
    <mx:TextArea id="ta"  width="450" height="450" x="10" y="40" fontSize="12">
        <mx:text><![CDATA[Hailed by Entertainment Weekly as not only "the best comedy on TV this year" but "simply the best TV," the Emmy Award-winning comedy "30 Rock" is told through the comedic voice of Golden Globe winner Tina Fey ("Liz Lemon") and features Golden Globe winner Alec Baldwin ("Jack Donaghy") as a top network executive and Tracy Morgan ("Tracy Jordan") as the unpredictable star of Lemon's hit variety show, "TGS with Tracy Jordan." Lemon constantly has her hands full, juggling corporate interference from Donaghy and off-the-handle star antics from Jordan, all while attempting to salvage her own personal life.
Also rounding out the cast are Jane Krakowski ("Jenna Maroney") as the co-star of "TGS"; Scott Adsit ("Pete Hornberger") as the variety show's producer; Jack McBrayer ("Kenneth the Page") as the over-eager and effortlessly endearing NBC page; Judah Friedlander ("Frank") as the sardonic slacker on the writing staff; Katrina Bowden ("Cerie") as Lemon's young, flighty assistant; and Keith Powell ("Toofer") as the sophisticated, yet sarcastic Harvard-alum writer.
[38]]]]></mx:text>
    </mx:TextArea>
</mx:Application>