Foros del Web » Creando para Internet » Flash y Actionscript »

iniciar formato de texto en input txt

Estas en el tema de iniciar formato de texto en input txt en el foro de Flash y Actionscript en Foros del Web. 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 ...
  #1 (permalink)  
Antiguo 13/10/2008, 11:14
Usuario no validado
 
Fecha de Ingreso: marzo-2007
Mensajes: 238
Antigüedad: 17 años
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!::
  #2 (permalink)  
Antiguo 13/10/2008, 11:18
Usuario no validado
 
Fecha de Ingreso: marzo-2007
Mensajes: 238
Antigüedad: 17 años
Puntos: 5
Respuesta: iniciar formato de texto en input txt

tampoco funciona aplicando el formato al crear los campos:
Código PHP:
for (var i in this) {
    if (
this[i] instanceof TextField) {
    
this[i].border true;
    
this[i].type "input";
    
//
    
newFocus.setTextFormat(my_fmt);

:(
  #3 (permalink)  
Antiguo 13/10/2008, 12:28
Usuario no validado
 
Fecha de Ingreso: marzo-2007
Mensajes: 238
Antigüedad: 17 años
Puntos: 5
Respuesta: iniciar formato de texto en input txt

Bueno... creo quedo asi
Código PHP:
var someListener:Object = new Object();
someListener.onSetFocus = function(oldFocusnewFocus) {
    var 
nTxt:TextField = eval(newFocus);
    
//
    
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>";
    
//
    
nTxt.onChanged= function () {
        
this.setTextFormat(my_fmt);
        
    }
}; 
:)
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:46.