PDA

View Full Version : how do i assign values to dynamically generated variables ?


KEN
12-04-2003, 06:38 AM
how do i assign dynamic values to dynamically generated variables ? for example:

for(i=1; i<10; i++){
("a"+i)=i
}

how do i get
a1=1
a2=2
..
..
and so on

thanks

CyanBlue
12-04-2003, 08:06 AM
Howdy and Welcome... ;)

You can add proper path to the variable you are creating like this...for (i = 1 ; i < 10 ; i++)
{
this["a" + i] = i;
_level0["a" + i] = i;
_root["a" + i] = i;
_level0.someMovieClip["a" + i] = i;
}

[useastags]

KEN
12-04-2003, 09:50 PM
thanks.