Convert number to hex code AS3

If you trace a colour you’ve input as 0xFFFFFF, it’ll trace back as some big number (no time to do exmaple properly). If you need to say, then reuse this color number and put it back in to htmltext formatting for colour (which deals in hex) – you can use toString(16) to convert it back (as a string) to hex.

var fieldColor:String = fieldColor.toString(16);
Tech Reference:

Leave a Reply

Your email address will not be published. Required fields are marked *

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑