Comunidad de diseño web y desarrollo en internet online

concatenar dos variables

Citar            
MensajeEscrito el 09 Mar 2005 06:48 pm
Si tengo varias variables del tipo: texto1, texto2, texto3... y quiero mediante un bucle ir asignandolas a un cuadro de texto

Código :

for(i=1; i<numart; i++) {
   this.createTextField("cuadrotexto"+i,depth+2,30,posy,150,80);
   this["cuadrotexto"+i].text = texto+i;
}


:crap: pq no funciona????
Si hago un trace de texto+i en el bucle, devuelve "NaN", q no se q quiere decir

Por Raditz

51 de clabLevel



Genero:Masculino  

Todas partes

msie
Citar            
MensajeEscrito el 09 Mar 2005 06:54 pm
prueba asi

Código :

for(i=1; i<numart; i++) {
   this.createTextField("cuadrotexto"+i,depth+2,30,posy,150,80);
   this["cuadrotexto"+i].text = this["texto"+i];
}


Saludos :D

Por flasher

Invitado



 

clabbrowser
Citar            
MensajeEscrito el 09 Mar 2005 06:58 pm
joer pensaba q ese metodo solo era aplicable a objetos, no a variables :oops:

Por Raditz

51 de clabLevel



Genero:Masculino  

Todas partes

msie

 

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