I have built an array of colors that I want to assign to clips on stage but there is something missing in a script and I’m stuck:
[AS]
//create a script assigning RGB color to a clip
function combineRGB (red, green, blue) {
//combine the color values into a single number
var RGB = (red << 16) | (green << 8) | blue;
return RGB;
}
MovieClip.prototype.setRGB = function (colorValue) {
new Color (this).setRGB (colorValue);
};
//set color values
color1 = combineRGB (76, 98, 139);
color2 = combineRGB (124, 54, 52);
color3 = combineRGB (92, 92, 118);
color4 = combineRGB (119, 91, 80);
//declare a new Array: “colors” for retrieving values later
colors = new Array ();
for (i = 1; i < 4; i++) {
colors* = [“color” + i];
//trace (colors*);
//the following should(?) assign color* to box* (boxes are objects on stage)
this[“box” + i + “_mc”].setRGB (colors*);
}
[/AS]
I can assign one of the colors to all the boxes and it works:
this[“box” + i + “_mc”].setRGB (color5);
but that’s not quite the effect I’m looking for :{