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

Package | flexlib.controls
Class | public class Highlighter
Inheritance | Highlighter Object

Public Properties

| Property | Defined By
--- | --- | ---
|  | bitmap : Bitmap The Bitmap object used for drawing the highlights. | Highlighter
|  | field : TextField The TextField being highlighted. | Highlighter
|  | highlightColor : uint The color used to highlight strings (RGBA). | Highlighter
|  | xOffset : Number The horizontal offset for highlights. | Highlighter
|  | yOffset : Number The vertical offset for highlights. | Highlighter

Public Methods

| Method | Defined By
--- | --- | ---
|  | Highlighter(textField:TextField, color:uint = 0xffff0000, xOffset:Number = 0, yOffset:Number = 0) Finds & highlights strings in a text field. | Highlighter
|  | highlightNext(word:String, caseSensitive:Boolean = true):void Highlights the first instance of a string after the cursor position. | Highlighter
|  | highlightPrevious(word:String, caseSensitive:Boolean = true):void Highlights the first instance of a string before the cursor position. | Highlighter
|  | highlightWordInstances(word:String, caseSensitive:Boolean = true):void Highlights all instances of a string. | Highlighter
|  | reset():void Resets the Highlighter, clearing all visible highlights and emptying the array of character boundaries. | Highlighter

Property Detail

bitmap | property

`public var bitmap:Bitmap`

The Bitmap object used for drawing the highlights. Publicly exposed so that effects can be applied if desired.

field | property |

`public var field:TextField`

The TextField being highlighted.

highlightColor | property |

`public var highlightColor:uint`

The color used to highlight strings (RGBA).

The default value is `0xffff0000 (red)`.

xOffset | property |

`public var xOffset:Number`

The horizontal offset for highlights.

The default value is `0`.

yOffset | property |

`public var yOffset:Number`

The vertical offset for highlights.

The default value is `0`.

Constructor Detail

Highlighter | () | Constructor

`public function Highlighter(textField:TextField, color:uint = 0xffff0000, xOffset:Number = 0, yOffset:Number = 0)`

Finds & highlights strings in a text field.

Parameters

| `textField:TextField` — The TextField containing the text to highlight
| `color:uint` (default = `0xffff0000`)`` — The color to make the highlight (RGBA). Default is 0xffff0000 (solid red).
| `xOffset:Number` (default = `0`)`` — If necessary, the horizontal offset of the highlight. Useful when the TextField has some padding applied to it. Default is 0.
| `yOffset:Number` (default = `0`)`` — If necessary, the vertical offset of the highlight. Useful when the TextField has some padding applied to it. Default is 0.

Method Detail

highlightNext | () | method

`public function highlightNext(word:String, caseSensitive:Boolean = true):void`

Highlights the first instance of a string after the cursor position.

Parameters

| `word:String` — The string to find and highlight.
| `caseSensitive:Boolean` (default = `true`)``

highlightPrevious | () | method |

`public function highlightPrevious(word:String, caseSensitive:Boolean = true):void`

Highlights the first instance of a string before the cursor position.

Parameters

| `word:String` — The string to find and highlight.
| `caseSensitive:Boolean` (default = `true`)``

highlightWordInstances | () | method |

`public function highlightWordInstances(word:String, caseSensitive:Boolean = true):void`

Highlights all instances of a string.

Parameters

| `word:String` — The string to find and highlight.
| `caseSensitive:Boolean` (default = `true`)``

reset | () | method |

`public function reset():void`

Resets the Highlighter, clearing all visible highlights and emptying the array of character boundaries.

Mercredi Juillet 6 2011, 09:45 PM +02:00