Packageflexlib.controls
Classpublic class Highlighter



Public Properties
 PropertyDefined 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
 MethodDefined 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
bitmapproperty
public var bitmap:Bitmap

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

fieldproperty 
public var field:TextField

The TextField being highlighted.

highlightColorproperty 
public var highlightColor:uint

The color used to highlight strings (RGBA).

The default value is 0xffff0000 (red).

xOffsetproperty 
public var xOffset:Number

The horizontal offset for highlights.

The default value is 0.

yOffsetproperty 
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.