AName
01-11-2006, 01:21 PM
I was wondering if its possible to make the name of an Array varry. Something like this,var i=1;
for(i=1;i>4;i++)
{
var ary+i=new Array('red'+i,'green'+i,'blue'+i);
}
alert(ary3[1]);This would alert "green3", and it would make 3 Arrays, ary1, ary2, and ary3, all with the values of red1,green1,blue1 then red2 and so on. Any ideas on how this would work?
for(i=1;i>4;i++)
{
var ary+i=new Array('red'+i,'green'+i,'blue'+i);
}
alert(ary3[1]);This would alert "green3", and it would make 3 Arrays, ary1, ary2, and ary3, all with the values of red1,green1,blue1 then red2 and so on. Any ideas on how this would work?