Wednesday, February 20, 2008
AS3 Color (TextFormat)
Wednesday, February 20, 2008
I am applying a color (white) to a field in a class. Simple enough.
white = new TextFormat();Now later on, I flip through the DisplayObject looking for that value. I never find it, but tracing shows me what value I should be looking for.
white.color = 0xFFFFFF;
var nCount:Number = container.numChildren;So what gets traced? The value: 16777215. I am assuming that 2 extra digits in there are translations of the alpha value. However, it still seems a little strange... but I am no mathematician or color theorist. I'm sure its correct, and I know what to look for, but I don't know exactly why yet ;) Magic numbers to me at the moment.
for ( var i:Number = 0; i < nCount; i++ )
{
var curSprite = container.getChildAt( i );
trace( i, curSprite.label_txt.getTextFormat().color );
...
Comments:
There are currently 3 Comments:



