Hi Jason,

Is something like this what you need?

function dec2hex(input):String {
        var hex:Number;
        var stgHex:String = uint(input).toString(16);
        while (stgHex.length < 6){
                stgHex = "0"+stgHex;
        }
        stgHex = "0x"+stgHex;
        return stgHex;
}

function hex2dec(input):String {
        return String(uint(input));
}

// test run
var decColor:Number = 102;
var hexColor:String = dec2hex(decColor);
trace("hex: "+hexColor);
trace("dec: "+hex2dec(hexColor));

hth,
Bob

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Merrill,
Jason
Sent: Thursday, July 24, 2008 10:47 AM
To: Flash Coders List
Subject: [Flashcoders] ColorPicker.selectedValue to #hex?

How can I translate the ColorPicker.selectedValue to a 6 digit hex
number?  i.e. if the color selected is, 000066, if I trace
ColorPicker.selectedColor, traces 102.  I tried gooling for an
Actionscript hex converter, but didn't come up with anything.  Thanks.


Jason Merrill 
Bank of America 
Enterprise Technology & Global Risk L&LD 
Instructional Technology & Media

Join the Bank of America Flash Platform Developer Community 

Are you a Bank of America associate interested in innovative learning
ideas and technologies?
Check out our internal  GT&O Innovative Learning Blog & subscribe. 

 
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to