# Using arrays to define mc color

**URL:** <https://forum.kirupa.com/t/using-arrays-to-define-mc-color/294432>\
**Category:** flash\
**Created:** [August 13, 2009, 9:41pm UTC](https://forum.kirupa.com/t/using-arrays-to-define-mc-color/294432 "2009-08-13T21:41:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![litl\_CodeChick](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@litl\_CodeChick](https://forum.kirupa.com/u/litl_CodeChick)\
**Post date:** [August 13, 2009, 9:41pm UTC](https://forum.kirupa.com/t/using-arrays-to-define-mc-color/294432/1 "2009-08-13T21:41:08Z")

</div>

I know it’s possible (and the answer must be under my nose) but I am at a loss as to how to accomplish this:

I have 5 movie clips on the stage, and their instance names are in one array. I then have an array with hexidecimals that I want to assign the colors to the movie clip. So, in essence clipArray[0] would obtain hueArray[0] and so on and so forth. Here is the small code snippet I am working with.

stop();  
var clipArray:Array = [one\_mc, two\_mc, three\_mc, four\_mc, five\_mc];  
var hueArray:Array = [“0xd50000”,“0xff9000”,“0xfcff00”,“0x00c91c”,“0x0050d5”];

for (var i:int = 0; i \< clipArray.length; i++)  
{  
clipArray\*.buttonMode = true;  
for (var j:int = 0; j \< hueArray.length; j++)  
{  
trace(“function works”);  
}  
}

I want to keep my code clean but tend to get buried in for-loops so thank you in advance to anyone who can explain my wrongdoing and set my poor code straight!!! :hugegrin:
