| 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 | ||
| 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 | ||
| bitmap | property |
public var bitmap:BitmapThe Bitmap object used for drawing the highlights. Publicly exposed so that effects can be applied if desired.
| field | property |
public var field:TextFieldThe TextField being highlighted.
| highlightColor | property |
public var highlightColor:uintThe color used to highlight strings (RGBA).
The default value is 0xffff0000 (red).
| xOffset | property |
public var xOffset:NumberThe horizontal offset for highlights.
The default value is 0.
| yOffset | property |
public var yOffset:NumberThe vertical offset for highlights.
The default value is 0.
| Highlighter | () | Constructor |
public function Highlighter(textField:TextField, color:uint = 0xffff0000, xOffset:Number = 0, yOffset:Number = 0)Finds & highlights strings in a text field.
ParameterstextField: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.
|
| highlightNext | () | method |
public function highlightNext(word:String, caseSensitive:Boolean = true):voidHighlights 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):voidHighlights 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):voidHighlights all instances of a string.
Parameters
word:String — The string to find and highlight.
| |
caseSensitive:Boolean (default = true) |
| reset | () | method |
public function reset():voidResets the Highlighter, clearing all visible highlights and emptying the array of character boundaries.