I feel guilty that I haven’t written in a two weeks but I have been working on a longer article and it seems that I am limited on the number of words I can write in a week. Anyway I wanted to make a small post about this topic because I had a bit of trouble to find how to do it. When you work with colours, the common way to write a colour is to write it a has hex string to a uint; example: 0xff0000. When you trace that uint what you will get is the base 10 equivalent which is not really readable and gives no hint about what colour it is. So to solve this problem here is a quick way to convert a uint into a Hexadecimal String for tracing or tracking purpose:
var myUint:uint = 0xff000; // this is the colour red trace (myUint.toString(16)); //will trace ff0000;
My guess is that it will trace the number using 16 as a base.
Well that’s it for now might have more on AIR later on.



#1 by Tyler Egeto - February 3rd, 2009 at 22:37
Hey, thanks for sharing this, I had no idea you could to this. Definitely something that could have come in handy in the past.
#2 by loover - September 9th, 2009 at 16:08
great! how convert hex to uint&
#3 by loover - September 9th, 2009 at 16:09
sorry. how covvert uint to hex?