Comunidad de diseño web y desarrollo en internet online

Generar variable dinámica

Citar            
MensajeEscrito el 19 Mar 2007 01:57 pm
tengo un PHP que me genera el siguiente código:

Código :

cant=6&sec1=1&nom1=FIESTAS DE FIN DE ÑO&sec2=2&nom2=TEATRO DE NEGOCIOS&sec3=3&nom3=FAMILY DAY&sec4=4&nom4=ESENCIALES&sec5=5&nom5=EVENTOS TEMÁTICOS&sec6=6&nom6=EVENTOS MOTIVACIONALES


quiero cargarlos dentro de un TXT y poder ver las variables de nombre por separado. o sea
nombre1=valor1
nombre2=valor2
nombre3=valor3
etc

tengo este código:
VER CORCHETES
####

Código :

System.useCodepage=true;
var carga = new LoadVars();
carga.load("secciones.php");
carga.onLoad = function() {
var n:Number=this.cant;
texto_txt.text = "cantidad="+this.cant+newline;
//bucle
if(n!=0){
for(i=1;i<=n;i++){
texto_txt.text+= "nombre"+i+"="+[this.nom+i]+newline;
}
}
//fin bucle
texto_txt.text+= newline+"fin";
}


####
no funciona ¿alguien me puede dar una mano?
gracias

Por MarcosMan

2 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 19 Mar 2007 02:34 pm
ya lo resolví
la respuesta estaba en los corchetes. estaban mal evaluados

Código :

texto_txt.text+= "nombre"+i+"="+this[nom+i]+newline;


por si a alguien alguna vez le sirve.

yâmata

Por MarcosMan

2 de clabLevel



Genero:Masculino  

firefox

 

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