Re: [Flashcoders] ColorPicker.selectedValue to #hex?

2008-07-27 Thread Fumio Nonaka
I am a little late. But another way to make the script short: function dec2hex(input:Number):String { var hex:Number; // var stgHex:String = uint(input).toString(16); var stgHex:String = uint(input+0x100).toString(16).substr(1); /* while

RE: [Flashcoders] ColorPicker.selectedValue to #hex?

2008-07-24 Thread Merrill, Jason
Sorry, that was meant for the Flex list, but it could also easily be answered here as well. I'm using the Flex 3 ColorPicker component. Thanks. Jason Merrill Bank of America Enterprise Technology Global Risk LLD Instructional Technology Media Join the Bank of America Flash Platform

Re: [Flashcoders] ColorPicker.selectedValue to #hex?

2008-07-24 Thread Jim McIntyre
Merrill, Jason wrote: How can I translate the ColorPicker.selectedValue to a 6 digit hex number? i.e. if the color selected is, 66, if I trace ColorPicker.selectedColor, traces 102. I tried gooling for an Actionscript hex converter, but didn't come up with anything. Thanks. This may

RE: [Flashcoders] ColorPicker.selectedValue to #hex?

2008-07-24 Thread Merrill, Jason
If you're manipulating the number, as opposed to storing or displaying it, Thanks, but yeah, the purpose is to display the hex #, the full 6 digits, to the user as #006699. thanks though! Jason Merrill Bank of America Enterprise Technology Global Risk LLD Instructional Technology Media

RE: [Flashcoders] ColorPicker.selectedValue to #hex?

2008-07-24 Thread Robert Leisle
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; }

Re: [Flashcoders] ColorPicker.selectedValue to #hex?

2008-07-24 Thread Hans Wichman
Hi Jason, trace (Number(102).toString(16)); hth, JC On Thu, Jul 24, 2008 at 8:46 PM, Merrill, Jason [EMAIL PROTECTED] wrote: If you're manipulating the number, as opposed to storing or displaying it, Thanks, but yeah, the purpose is to display the hex #, the full 6 digits, to the user as

Re: [Flashcoders] ColorPicker.selectedValue to #hex?

2008-07-24 Thread Jim McIntyre
Merrill, Jason wrote: If you're manipulating the number, as opposed to storing or displaying it, Thanks, but yeah, the purpose is to display the hex #, the full 6 digits, to the user as #006699. thanks though! The function I included at the bottom should do that. I modified it to pad the

RE: [Flashcoders] ColorPicker.selectedValue to #hex?

2008-07-24 Thread Merrill, Jason
Here is the function I ended up with if it's useful to anyone, somewhat deluxe-ified: public static function decimalToHexidecimal(number:Number, upperCase:Boolean=false, addPound:Boolean=false, addOx:Boolean=false ):String { var hexString:String = Number(number).toString(16);