Comunidad de diseño web y desarrollo en internet online

Ayuda con TextFormat

Citar            
MensajeEscrito el 14 Ago 2007 05:43 pm
Hola quisiera saber como hacer para que las letras de un formulario sean grices y al seleccionar el campo de texto para escribor se hagan negras y al seleccionar otra cosa se hagan grices de nuevo y que al darle click se borre lo que este escrito. Tengo esto:

Código :

texto.text="mensaje";
var escribiendo = new Text Format();
escribiendo.color="0x000000";
var noseleccionado = new TextFormat();
noseleccionado.color = "0x666666";
texto.onSetFocus=function(){
texto.setTextFormat(escribiendo);
//Al quitar esta linea texto.text="" todo funciona bien obviamente no borra el texto y si la escribo si //la borro pero no pone el formato que estableci
texto.text="";
}

Y on KillFocus lo mismo pero alreves :?

Por dan12

155 de clabLevel



Genero:Masculino  

México

firefox
Citar            
MensajeEscrito el 15 Ago 2007 05:53 am
hola dan12!!! quizas sea buena idea usar la funcion change() y enter que especifican cuando el texto ha cambiado y cuando el usuario hace enter en el

saludos!!!

Por andres_santos

236 de clabLevel



 

opera
Citar            
MensajeEscrito el 15 Ago 2007 03:45 pm

Código :

texto_txt.text = "texto inicio";
var my_fmt:TextFormat = new TextFormat();
texto_txt.onChanged = function() {
   my_fmt.color = 0x000000;
   texto_txt.setTextFormat(my_fmt);
};
texto_txt.onSetFocus = function() {
   texto_txt.text = "";
};
texto_txt.onKillFocus = function() {
   my_fmt.color = 0x666666;
   texto_txt.setTextFormat(my_fmt);
};



Prueba con esto..donde texto_txt es tu campo de texto en el escenario

Por chko

109 de clabLevel



 

México

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.