# Set color on dynamic created mcs

**URL:** <https://forum.kirupa.com/t/set-color-on-dynamic-created-mcs/233150>\
**Category:** Uncategorized\
**Created:** [July 20, 2007, 3:35pm UTC](https://forum.kirupa.com/t/set-color-on-dynamic-created-mcs/233150 "2007-07-20T15:35:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![christianR](https://avatars.discourse-cdn.com/v4/letter/c/e36b37/32.png) [@christianR](https://forum.kirupa.com/u/christianR)\
**Post date:** [July 20, 2007, 3:35pm UTC](https://forum.kirupa.com/t/set-color-on-dynamic-created-mcs/233150/1 "2007-07-20T15:35:52Z")

</div>

Hi, i have a newbee problem when changing the color from attached clips.

I create a mc on the root level from the library by attachMovie (box1).

box1 creates a second mc from the library by attachMovie (box2).

On the root level I have a button who change the color of both mcs by new Color / setRGB.

But box2 will have the same color than box1, regardless which color I set to box2.

Button-AS (FLA is attached):

```auto

this.onPress = function () {
    // set box1 to green
    (new Color(_root.my_box_dyn1)).setRGB(0x00FF00); 

    // set box2 to red
    (new Color(_root._root.my_box_dyn1.my_box_dyn2)).setRGB(0xFF0000); 
}

```

Whats wrong?
