un ejemplo:
Código :
var format1_fmt:TextFormat = new TextFormat();
format1_fmt.font = "Arial";
format1_fmt.color = 0x00CCDD;
var format2_fmt:TextFormat = new TextFormat();
format2_fmt.font = "Courier";
format2_fmt.color = 0xFFBF00;
var string1:String = "Sample string number one."+" ";
//+newline
var string2:String = "Sample string number two.";
//this.createTextField("my_txt", this.getNextHighestDepth(), 0, 0, 300, 200);
this.createTextField("my_txt", 1, 0, 0, 300, 200);
my_txt.multiline = true;
my_txt.wordWrap = true;
my_txt.text = string1;
var firstIndex:Number = my_txt.length;
my_txt.text += string2;
var secondIndex:Number = my_txt.length;
my_txt.setTextFormat(0, firstIndex, format1_fmt);
my_txt.setTextFormat(firstIndex, secondIndex, format2_fmt);He pensado en unas funciones como estas:
Código :
function formato(primero, segundo) {
my_txt.setTextFormat(primero, segundo, format1_fmt);
}
function formato2(one, two) {
my_txt.setTextFormat(10, 15, format2_fmt);
}
my_txt = formato(0, 3, format1_fmt);
my_txt = formato2(3, 5, format2_fmt);donde le digo de que caracter a donde pero solo me funciona uno alguien me puede echar la mano
