[as2] array loop help

i have a number of buttons that use tweens for rollovers. instead of making a rollover function for each button, i made a generic rollover that uses an array.

everything works perfect when building the array manually, even though i forgot the quotes around each entry. adding them however, breaks it.

var adIcons_array:Array = new Array(adIconCover1, adIconCover2, adIconCover3, adIconCover4, adIconCover5);

this is the output
_level0.adIconCover1,_level0.adIconCover2,_level0.adIconCover3,_level0.adIconCover4,_level0.adIconCover5

i decided to make a simple loop to build the array automatically, since it is very predictable. i only have 5 here, but eventually there will be 5 groups of 12.

var adIcons_array:Array = new Array();

for (i=0; i<6; i++) {
	adIcons_array* = "adIconCover"+i;
}

this is the output
adIconCover0,adIconCover1,adIconCover2,adIconCover3,adIconCover4,adIconCover5

the difference is one extra entry, adIconCover0, and losing _level0.

i figure an extra entry doesn’t matter much, and i understand the _level0 is basically the same as _root, so i tried adding that into the array builder, but still no luck.

var adIcons_array:Array = new Array();

for (i=0; i<6; i++) {
	adIcons_array* = "_root.adIconCover"+i;
}

_root.adIconCover0,_root.adIconCover1,_root.adIconCover2,_root.adIconCover3,_root.adIconCover4,_root.adIconCover5

i finally got it to work with this, which gave me the _level0 results again.

var adIcons_array:Array = new Array();

for (i=0; i<6; i++) {
	adIcons_array* = eval("_root.adIconCover"+i);
}

i know it’s working so i should probably just be happy and continue working, but i’m hoping someone can spread some light on when to use eval, and when not to and why the quotes broke the initial array.

i found this post from a couple days back that is related:

thank you

var root:MovieClip = this;
var adIcons_array:Array = [];

for (var i:Number = 0; mc=root["adIconCover"+(++i)];) {
	adIcons_array.push(mc);
}
trace(adIcons_array);