import flashx.textLayout.elements.Configuration;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.TextDecoration;
import flashx.textLayout.formats.TextLayoutFormat;
import spark.events.TextOperationEvent;
[Bindable]
protected static var lineCount:uint = 0;
protected function richEdTxt_changeHandler(evt:TextOperationEvent):void {
lineCount = richEdTxt.mx_internal::textContainerManager.numLines;
lineCnt.text = lineCount.toString();
}
protected function init():void {
var cfg:Configuration = TextFlow.defaultConfiguration;
var normalTLF:TextLayoutFormat = new TextLayoutFormat(cfg.defaultLinkNormalFormat);
normalTLF.color = 0xFF0000;
var hoverTLF:TextLayoutFormat = new TextLayoutFormat(cfg.defaultLinkHoverFormat);
hoverTLF.color = 0xFF00FF;
hoverTLF.textDecoration = TextDecoration.NONE;
var activeTLF:TextLayoutFormat = new TextLayoutFormat(cfg.defaultLinkActiveFormat);
activeTLF.color = 0x00FF00;
cfg.defaultLinkNormalFormat = normalTLF;
cfg.defaultLinkHoverFormat = hoverTLF;
cfg.defaultLinkActiveFormat = activeTLF;
TextFlow.defaultConfiguration = cfg;
}
The quick brown fox jumps over the lazy dog.