AS2 Adding multiple movieclips within a for loop

Hi,

I’m sure this has been asked before but couldn’t find anything to my specific problem.

Basically I have 5 movieclips I want positioned around the stage. So I figure the best way to this is with a for loop. However the way I’ve coded it doesn’t appear to add new movieclips and seems to just move the first movieclip 5 times and it always ends up with an x of 169. Here’s my code:

for (i=0; i<5; i++){
            
    var barName:MovieClip = 
    _root.game.attachMovie("butSquare","r1wBar"+i,_root.getNextHighestDepth());


    barName._width = 22;
    barName._height = 344;
    barName._y = -170;
            
    if(i == 0) {
        barName._x = -168;
    }
    else if(i == 1) {
        barName._x = -105;
    }
    else if(i == 2) {
        barName._x = -11;
    }
    else if(i == 3) {
        barName._x = 79;
    }
    else if(i == 4) {
        barName._x = 169;
    }
}

Is it something to do with the way I’m referencing the movieclip?

Any help would be greatly appreciated.

McCoy