I am updating the position of movieClips stored in an array with an enter frame event loop.
function onEnterFrame(e:Event){
areaArray[1].x = areaArray[0].x + areaArray[0].spacing.width;
areaArray[2].x = areaArray[1].x + areaArray[1].spacing.width;
areaArray[3].x = areaArray[2].x + areaArray[2].spacing.width;
areaArray[4].x = areaArray[3].x + areaArray[3].spacing.width;
areaArray[5].x = areaArray[4].x + areaArray[4].spacing.width;
}
I would like to do the same thing with a for loop but cant figure it out. My below example doesn’t work. But in essences this is what i would like to do adding 1 to the index called by the for loop
function onEnterFrame(e:Event){
for (var j:int = 0; j < areaArray.length; j++) {
areaArray[**[COLOR=#ff0000](j+1)[/COLOR]**].x = areaArray[j].x + areaArray[j].spacing.width;
}
}
can someone steer me in the right direction
Thanks!