Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/10/2008, 11:14
worldPeace_Plis
Usuario no validado
 
Fecha de Ingreso: marzo-2007
Mensajes: 238
Antigüedad: 17 años, 1 mes
Puntos: 5
iniciar formato de texto en input txt

Hola, si uso campos de entrada de txt, no me les da formato a la primera vez que son seleccionados (setFocus), si no hasta la segunda vez, es decir, no me reconoce el formato de texto que le quiero dar, me aplica el default (times new roman), como puedo hacer que desde crear el txtfield, obvio, sin nada de texto aun, este ya tenga aplicado el txt format
Código PHP:
    var my_fmt:TextFormat = new TextFormat();
    
//my_fmt.color = 0xCC00FF;
    
my_fmt.font 'Verdana';
    
my_fmt.size 12;

this.createTextField("one_txt"10010022);
this.createTextField("two_txt"202510022);
this.createTextField("three_txt"305010022);
this.createTextField("four_txt"407510022);

for (var 
i in this) {
    if (
this[i] instanceof TextField) {
    
this[i].border true;
    
this[i].type "input";
    }
}

this.createTextField("status_txt"this.getNextHighestDepth(), 20010300100);
status_txt.html true;
status_txt.multiline true;

var 
someListener:Object = new Object();
someListener.onSetFocus = function(oldFocusnewFocus) {
    
status_txt.htmlText "<b>setFocus triggered</b>";
    
status_txt.htmlText += "<textformat tabStops='[20,80]'>";
    
status_txt.htmlText += "&nbsp;\toldFocus:\t"+oldFocus;
    
status_txt.htmlText += "&nbsp;\tnewFocus:\t"+newFocus;
    
status_txt.htmlText += "&nbsp;\tgetFocus:\t"+Selection.getFocus();
    
status_txt.htmlText += "</textformat>";
    
//
    
newFocus.setTextFormat(my_fmt);
};
Selection.addListener(someListener); 
::Gracias!::