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

ayuda para Campos de texto

Estas en el tema de ayuda para Campos de texto en el foro de Flash y Actionscript en Foros del Web. Tengo el siguiete actionscript: loadVariables("noticias.txt", "_root"); _root.createTextField("mytext", 1, 0, 0, 300, 100); mytext.variable = "titulo1"; mytext.multiline = true; mytext.wordWrap = true; mytext.background = true; mytext.backgroundColor ...
  #1 (permalink)  
Antiguo 18/07/2005, 12:28
 
Fecha de Ingreso: julio-2005
Mensajes: 9
Antigüedad: 18 años, 9 meses
Puntos: 0
ayuda para Campos de texto

Tengo el siguiete actionscript:

loadVariables("noticias.txt", "_root");
_root.createTextField("mytext", 1, 0, 0, 300, 100);
mytext.variable = "titulo1";
mytext.multiline = true;
mytext.wordWrap = true;
mytext.background = true;
mytext.backgroundColor = 10066329;
mytext.border = true;
mytext.textColor = 16777215;
if (mytext.variable == "")
{
mytext.removeTextField();

como ven estoy cargando un archivo de texto externo, necesito que a la hora de cargar el archivo y este no tiene texto para mostrar, no me cree el TextField.....si alguien me puede ayudar se lo agradezco
Gracias.....
}
  #2 (permalink)  
Antiguo 18/07/2005, 12:36
Avatar de TMeister
Crazy Coder
 
Fecha de Ingreso: enero-2002
Ubicación: En la Oficina
Mensajes: 2.880
Antigüedad: 22 años, 3 meses
Puntos: 193
yo usaria LoadVars.

Código:
var load_lv:LoadVars = new LoadVars();
function init() {
	load_lv.onLoad = setText;
	load_lv.load("archivo.txt");
}
function setText() {
	if (this.miVariable.length) {
		_root.createTextField("mytext", 1, 0, 0, 300, 100);
		mytext.text = this.miVariable;
		mytext.multiline = true;
		mytext.wordWrap = true;
		mytext.background = true;
		mytext.backgroundColor = 10066329;
		mytext.border = true;
		mytext.textColor = 16777215;
	}
}
init();
  #3 (permalink)  
Antiguo 18/07/2005, 14:12
 
Fecha de Ingreso: julio-2005
Mensajes: 9
Antigüedad: 18 años, 9 meses
Puntos: 0
TMeister

Gracias Tmeister, me resulto magnifico...te puedo pedir solo un favor....darme una pequeña explicación de la primer parte del codigo ya que estoy en la parte de aprendizaje del actionscript.......

Si no es mucha molestia...



Gracias
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 00:22.