# How to stop setTint from altering child objects?

**URL:** <https://forum.kirupa.com/t/how-to-stop-settint-from-altering-child-objects/269218>\
**Category:** flash\
**Created:** [August 24, 2008, 11:08pm UTC](https://forum.kirupa.com/t/how-to-stop-settint-from-altering-child-objects/269218 "2008-08-24T23:08:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marmad](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@marmad](https://forum.kirupa.com/u/marmad)\
**Post date:** [August 24, 2008, 11:08pm UTC](https://forum.kirupa.com/t/how-to-stop-settint-from-altering-child-objects/269218/1 "2008-08-24T23:08:09Z")

</div>

I haven’t been able to figure out a way to change the tint of a display object without effecting all of it’s child objects. And once you’ve changed the tint of the parent, you can’t seem to be able to change the tint of a child anymore. As in this code:

import flash.display.DisplayObject;  
import flash.display.Sprite;  
import fl.motion.Color;  
import flash.geom.ColorTransform;

var box:Sprite=new Sprite();  
box.graphics.beginFill(0xCCCCCC,1);  
box.graphics.drawRect(0,0,200,200);  
box.graphics.endFill()  
this.addChild(box);

var innerbox:Sprite=new Sprite();  
innerbox.graphics.beginFill(0x666666,1);  
innerbox.graphics.drawRect(50,50,100,100);  
innerbox.graphics.endFill()  
box.addChild(innerbox);

var c:Color = new Color();  
c.setTint(0xAAAAAA,1);  
box.transform.colorTransform = c;  
c.setTint(0xFF0000,1);  
innerbox.transform.colorTransform = c;

I can’t seem to apply a tint to the child once the parent has been tinted. This same problem exists with colorTransform.color as well. Anyone know how to get around this?
