Why won't this... (attachMovie)

I’m currently using this script:

x = 1;
while (x <= 12) {
    attachMovie("r_piece","red"+x,1);
    set("red"+x+"._x",100);
    x += 1;
}

But it only makes one movie clip. What do I need to change?