Understanding arrays and for-loops together

Hi,

Can some help me understand how arrays and for loops work together?

In the following code 100 rain drops are created with the first for loop and then moved with a second for loop the part that I don’t know understand 100% are as follow…

var rainDropArray = new Array();

for(var i:int=0; i<100; i++) {
var rainDrop:RainDrop = new RainDrop();
rainDrop.x = Math.random() * 550;
rainDrop.y = 0;
addChild(rainDrop);
rainDropArray.push(rainDrop);
}

this.addEventListener(Event.ENTER_FRAME, moveDrops);

function moveDrops(e:Event):void
{
for(var i:int=0; i<100; i++) {
rainDropArray*.y += 1;
}
}

The first thing I’m confused with is how to treat clips after they have been added to an array, for instance consider the firs for loop. Why couldn’t we just do something like this to add drops to stage?

for(var i:int=0; i<100; i++) {
var rainDrop:RainDrop = new RainDrop();
rainDrop.x = Math.random() * 550;
rainDrop.y = 0;
rainDropArray.push(rainDrop);
addChild(rianDropArray);
}

Basically adding the array directly to the stage since all clips have been already pushed into the array.

The next question is in the second for loop.

for(var i:int=0; i<100; i++) {
rainDropArray*.y += 1;
}

Why do you need to put the variable ‘i’ in the array?

rainDropArray*.y += 1;

why not just …?

rainDropArray.y += 1;

Sorry if my questions don’t make too much sense but I would like to have a better understanding how arrays and for loops work

Thanks a lot