Is there a way to “extract/trace()” the color of a dynamically generated texfield? Then use a button to change text color on mouse over and return original on mouse out?
var textvalue:TextField = new TextField();;
var format:TextFormat = new TextFormat();
var colorinmemory:int;
var colorArray:Array = new Array(0xFF0000,0x00FF00,0x0000FF);
format.color = colorArray[Math.floor(Math.random()*colorArray.length)];
textvalue.defaultTextFormat = format;
addChild(textvalue);
textvalue.text = "hello world";
function mouseOverA (event:MouseEvent):void{
//colorinmemory = textvalue.color; // won't work
trace(colorinmemory);
// some way to set text to black
}
a_btn.addEventListener (MouseEvent.MOUSE_OVER, mouseOverA);
function mouseOutA (event:MouseEvent):void{
// some way to re-set text to color
}
a_btn.addEventListener (MouseEvent.MOUSE_OUT, mouseOutA);
looking for some way to fill in the comment lines. Seems so simple but nothing I try works
anyone?
P