Имеется TextField с текстом в нем, к примеру черного цвета. Этот TextField можно редактировать, необходимо чтобы все изменения отображались хайлайтом, т.е. другим цветом.
Пример:
Текст до редактирования:
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit"
После редактирования:
"Lorem ipsum
la-la consectetuer
next adipiscing elit"
Пробовал делать чтото с input_txt.onChanged, но ничего хорошего из этого не вышло

Код:
this.createTextField("input_txt", 999, 34, 105, 530, 156);
input_txt.border = true;
//input_txt.selectable = false;
input_txt.wordWrap = true;
input_txt.multiline = true;
input_txt.type = "input";
input_txt.size = 20;
input_txt.background = 0x3052C0;
input_txt.color = 0xFF0000;
input_txt.text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.";
var text_old:String = input_txt.text;
var text_new:String;
var i:Number;
input_txt.onChanged = function(textfield_txt:TextField) {
text_new = input_txt.text;
trace(text_new);
if (text_old<>text_new) {
i = 0;
maxlen = Math.max(text_old.length, text_new.length);
while ((i<maxlen) && (text_old.charAt(i) == text_new.charAt(i))) {
i++;
}
j = 0;
while ((j<maxlen) && (text_old.charAt(text_old.length-j) == text_new.charAt(text_new.length-j))) {
j++;
}
j2 = text_new.length-j;
trace(i+':'+j+':'+j2);
}
text_old = input_txt.text;
var my_fmt:TextFormat = input_txt.getTextFormat();
my_fmt.color = 0xFF0000;
input_txt.setTextFormat(i, j2+1, my_fmt);
};
Подскажите как это реализовать?