Many of the new features in Flash 8 use ARGB color values. This is great because it allows you to store your color value (RGB) and alpha (A) in a single 32bit integer. Unfortunately, debugging can be tricky because Flash's built in Number.toString(16) method treats all numbers as signed integers. This can result in some unexpected results when tracing an ARGB value:

var RGB:Number = 0x99FFCC;
trace(RGB.toString(16)); // works fine, traces "99ffcc"
var ARGB:Number = 0xFF99CC66;
trace(ARGB.toString(16)); // not so good, traces "7fffffff"
Because Flash is treating the value as a signed integer, it can only use 31bits to represent the value (1bit represents the sign + or -). This forces Flash to truncate it to the maximum 31bit value, which is 7FFFFFFF.

To work around this, you need to split the number into smaller pieces, then concatenate them as strings. This is pretty easy to do (if a little convoluted looking), and results in the following function which you can copy and paste into your own projects:

function hexToString(p_hex:Number):String {
   // this should be all one line:
   return (((p_hex>>24) != 0)?Number(p_hex>>>24).toString(16):"")+
         Number(p_hex&0xFFFFFF).toString(16);
}

var ARGB:Number = 0xFF99CC66;
trace(hexToString(ARGB)); // yay, traces "ff99cc66"

If you'd like to learn more about bitwise operators, you can check out my article on "Using Bitwise Operators to Manipulate Bits and Color" on Adobe DevNet, or check out my Flash 8 Bootcamp (coming to London, UK and Edmonton, Canada - details coming soon).