flexlib :: library Documentation | All Packages | All Classes | Index | Frames No Frames |
Finder

Package | flexlib.controls.textClasses
Class | public class Finder
Inheritance | Finder Object

Public Methods

| Method | Defined By
--- | --- | ---
|  | Finder(textField:TextField) Finds strings in a TextField. | Finder
|  | findNext(string:String, caseSensitive:Boolean = true):int Finds the first instance of a string after the Finder's current carat position. | Finder
|  | findPrevious(string:String, caseSensitive:Boolean = true):int Finds the first instance of a string before the Finder's current carat position. | Finder
|  | indexesOf(string:String, caseSensitive:Boolean = true):Array Gets all indexes of a string in the TextField. | Finder
|  | setCarat(evt:MouseEvent):void Synchronizes the Finder's internal carat position with the TextField's carat position when the user manually sets it by clicking in the TextField. | Finder

Constructor Detail

Finder | () | Constructor

`public function Finder(textField:TextField)`

Finds strings in a TextField.

Parameters

| `textField:TextField` — The TextField to search.

Method Detail

findNext | () | method

`public function findNext(string:String, caseSensitive:Boolean = true):int`

Finds the first instance of a string after the Finder's current carat position.

Parameters

| `string:String` — The string to search for.
| `caseSensitive:Boolean` (default = `true`)``

Returns

| `int` — The character index of the string.

findPrevious | () | method |

`public function findPrevious(string:String, caseSensitive:Boolean = true):int`

Finds the first instance of a string before the Finder's current carat position.

Parameters

| `string:String` — The string to search for.
| `caseSensitive:Boolean` (default = `true`)``

Returns

| `int` — The character index of the string.

indexesOf | () | method |

`public function indexesOf(string:String, caseSensitive:Boolean = true):Array`

Gets all indexes of a string in the TextField.

Parameters

| `string:String` — The string to search for.
| `caseSensitive:Boolean` (default = `true`)``

Returns

| `Array` — An array of all the indexes of the string.

setCarat | () | method |

`public function setCarat(evt:MouseEvent):void`

Synchronizes the Finder's internal carat position with the TextField's carat position when the user manually sets it by clicking in the TextField.

Parameters

| `evt:MouseEvent`

Mercredi Juillet 4 2012, 09:36 PM +02:00