# \[H\] Change color while keeping the text appear

**URL:** <https://forum.kirupa.com/t/h-change-color-while-keeping-the-text-appear/316669>\
**Category:** flash\
**Created:** [November 29, 2010, 12:36pm UTC](https://forum.kirupa.com/t/h-change-color-while-keeping-the-text-appear/316669 "2010-11-29T12:36:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DieByMacro](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@DieByMacro](https://forum.kirupa.com/u/DieByMacro)\
**Post date:** [November 29, 2010, 12:36pm UTC](https://forum.kirupa.com/t/h-change-color-while-keeping-the-text-appear/316669/1 "2010-11-29T12:36:28Z")

</div>

I got some problems in changing color of an instance dynamically while still keeping the text in AS 3. I know that thing we can do easily in Flash ( no AS required ).Here’s the image I can do it in Flash to make it easier to understand:  
Before  
 ![](http://forum.kirupa.com/uploads/kirupa/6397/91b99169164a3697.jpg)  
After  
 ![](http://forum.kirupa.com/uploads/kirupa/6399/97ffa161d7f733e1.jpg)  
I can keep the text appear by placing the layers in order:  
 ![](http://forum.kirupa.com/uploads/kirupa/6400/47ceebba87591d24.jpg)

But I don’t get the same result if I do it in AS 3. ( I have an instance which has an text embed).  
Before  
 ![](http://forum.kirupa.com/uploads/kirupa/6402/89e026af80877024.jpg)  
After  
 ![](http://forum.kirupa.com/uploads/kirupa/6403/46a142ef4e70665d.jpg)  
As you can see, the text disappear. I think the text was behind the “new color”. I don’t know :ponder: Here’s my code of changing the color:

```php

private var colorInfo:ColorTransform;
public function update(i:int,j:int,content:String):void{
	this.colorInfo = this.transform.colorTransform;
	var myTween:Tween = new Tween(this,"alpha", Back.easeOut, 0, 1, 3, true);
	myTween.addEventListener(TweenEvent.MOTION_CHANGE,tweenColor);
}
private function tweenColor(event:TweenEvent):void{
	colorInfo.color=Color.interpolateColor(this.blue_color,this.run_color,event.position);
	this.transform.colorTransform=colorInfo;
}		

```
