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.
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;
}