# How to avoid children inheriting parent's colortransform properties?

**URL:** <https://forum.kirupa.com/t/how-to-avoid-children-inheriting-parents-colortransform-properties/313731>\
**Category:** flash\
**Created:** [September 8, 2010, 12:29pm UTC](https://forum.kirupa.com/t/how-to-avoid-children-inheriting-parents-colortransform-properties/313731 "2010-09-08T12:29:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![elliria](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@elliria](https://forum.kirupa.com/u/elliria)\
**Post date:** [September 8, 2010, 12:29pm UTC](https://forum.kirupa.com/t/how-to-avoid-children-inheriting-parents-colortransform-properties/313731/1 "2010-09-08T12:29:03Z")

</div>

hi guys,  
this is the issue:  
i have a series of button that open a drag box with textfield and a close button in it. The drag box has to have the same colour of the button. So here it goes:

```auto

[COLOR=DimGray]// array of buttons[/COLOR]
var quadratini:Array = [muh,miao];
[COLOR=DimGray]// array of colours[/COLOR]
var colori_qua:Array = [0x000033,0xCC0000];

var boxneutro:box = new box();
var ics:chiudi = new chiudi();
var box_text:TextField = new TextField();

boxneutro.addChild(ics);
boxneutro.addChild(box_text);

[COLOR=DimGray]// for loop through the bottons[/COLOR]
for (var k:int = 0; k <quadratini.length; k++) {
quadratini[k].addEventListener (MouseEvent.CLICK, app);
}

function app (event:MouseEvent):void {
[COLOR=DimGray]// array of buttons is associated to the array of colours[/COLOR]
quadratini.index == colori_qua.index;

        for (var k:int = 0; k <colori_qua.length; k++) 
 {
        if (event.target == quadratini[k]) {
    var cambia:ColorTransform=boxneutro.transform.colorTransform;
[COLOR=DimGray]// the box takes the colour of the botton clicked[/COLOR]
    cambia.color=colori_qua[k];
    boxneutro.transform.colorTransform=cambia;
    }
    }

```

the problem is that also the box’s children inherit the same colour and so they become invisible.

How’s possible to avoid that? :-/
