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: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
.
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):void
Highlights the first instance of a string after the cursor position.
Parametersword: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.
Parametersword: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.
Parametersword: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.