# Problem changing label color

**URL:** <https://forum.kirupa.com/t/problem-changing-label-color/305393>\
**Category:** flash\
**Created:** [February 24, 2010, 3:01pm UTC](https://forum.kirupa.com/t/problem-changing-label-color/305393 "2010-02-24T15:01:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flexy](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@Flexy](https://forum.kirupa.com/u/Flexy)\
**Post date:** [February 24, 2010, 3:01pm UTC](https://forum.kirupa.com/t/problem-changing-label-color/305393/1 "2010-02-24T15:01:50Z")

</div>

Hey guys  
I am building a dynamic RSS viewer in actionscript 3. I wrote a flex application to create the xml code, now I load the xml into my flash application.

Now the user of my flex app can pick a color for a thread. I import this hex value into flash to assign a background color of a movieclip. The problem is that the movieclip also has dynamic text in it.

With my function changeColor() I seem to be changing this font color aswell. I have tried to solve it by using a TextFormat but no luck. Any solutions? Most appreciated.

```auto
for each(var channel:XML in rssInfo.channels.channel)
	{
		var menuItem:MenuItem = new MenuItem();
		changeColor(menuItem,channel.color);
		
		menuItem.x = 512 + i*120;
		menuItem.y = 718;

		menuItem.menuLabel.text = channel.@name; 
		
		var format1_fmt:TextFormat = new TextFormat();
		format1_fmt.color = 0xFF0000;
		format1_fmt.size = 24;
		menuItem.menuLabel.setTextFormat(format1_fmt);

		addChild(menuItem);
		i++;
			
		}
}
function changeColor(object:MovieClip, color:Number){
	
     var colorchange:ColorTransform = new ColorTransform();
     colorchange.color = color;
     object.transform.colorTransform = colorchange;
}

```
