Wednesday, February 20, 2008
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 );
...
3 Comments:
-
said...
-
“If you are on a mac, open up the Calculator application, flip the view to "Programmer", then choose the HEX toggle in upper right. Type 0xFFFFFF..you'll see the decimal conversion of the hex value (by choosing DEC toggle in upper right), is 16777215.”
-
e.dolecki said...
-
“Ah man... right. I was expecting something back in HEX. Thats a great tip there, thanks!!”
-
Paulius Uza said...
-
“You can trace it as hexadecimal value by using "color_string.toString(16);"
Glad to see you finally working with AS3!”







