TextHighlighter

From Openzet

Jump to: navigation, search

Contents

Introduction

Image:2009-02-13 130738.png

TextHighlighter class lets you hightlight the words you type in using a TextInput or TextArea control.

Property

Usage

You can specify the target control by providing target property value like the following
<zet:TextHighlighter id="high" target="{ta}" searchStr="{word.text}"/>
and assign the value of searchStrproperty by providing it with a search string.

By invoking next() method, this control searches next string that matches searchStrproperty’s value and by calling prev() method, you can search previous strings that match the value of findText property.

Application Example

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:zet="org.openzet.controls.*">
<zet:TextHighlighter id="high" target="{ta}" findText="{word.text}"/>
<mx:TextInput id="word" x="10" y="10" text="and" 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="532" height="560" x="10" y="40" fontSize="12">
<mx:text><![CDATA[ WASHINGTON (CNN) -- The U.S. Navy arrested nine more suspected pirates off the coast of Somalia Thursday -- the second capture in two days -- after receiving a distress call from an Indian-flagged commercial ship.
Suspected pirates are arrested in the Gulf of Aden.
......
off the coast of Somalia in 2008, according to the International Maritime Bureau.
The task force led by the Vella Gulf was set up in January in an effort to clamp down on the attacks in the region, the southern approach to the Red Sea and the Suez Canal.]]></mx:text>
</mx:TextArea>
</mx:Application>
Personal tools
Participation
Silverlight