Quick Array + Loop Question

I’m making a really simple color chooser.

Basically I have an array which holds my colors. I have a movieclip on which i duplicate depending on the array’s length. Then I fill the movieclips with the proper colors stored in the array.

Now I’d like to make it so when the user clicks a movieclip(chooses a color) I want to trace that color value.

Right now, no matter what color I choose the last array element(RGB Color) get’s traced.

So if I choose black, it traces green(last color in the array).


myColors = new Array("0xFF000", "0x666666", "0xE3E3E3", "0xFFDEAD", "0x003300");
spacing = holder._width + 35;
holder._visible = false;
for (i = 0; i < myColors.length; i++) {
    holder.duplicateMovieClip("newholder" + i, i);
    newholder._x = 200;
    mc = this["newholder" + i];
    mc._x = spacing * i;
    clr = this.myColors*;
    a = new Color(mc);
    a.setRGB(myColors*);
    mc.onPress = function() {
        trace(clr);
    };
}