Converting a uint from hex to argb in Flash

There are some functions in actionscript that take uint in the form of argb and hex. It took me a while to figure out why my fills where not visible!

 

For instance

fillRect(rect:Rectangle, color:uint):void
fills a rectangular area of pixels with a specified ARGB color.

and

 

beginFill(color:uint, alpha:Number = 1.0):void
Specifies a simple one-color fill that Flash Player uses for subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object.
 
The graphics.beginFill function will take a uint containing standard HTML hex colors such as 0xEEEEEE (grey) or 0xFFFFFF (white)
wheras the fillRect takes an ARGB value as a uint
0xFFEEEEEE ( grey with opaque alpha) or 0xFFFFFFFF ( white with opaque alpha).
 
Converting between the two is just a matter of adding or subtracting the alpha.
 
so a hex uint (grey) 0xEEEEEE + an argb  Alpha 0xFF000000  will give you the  proper ARGB value without any need for conversion or type castsing.
 
 I hope this helps someone out.