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 (stgHex.length
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);
while
OK cool. Thanks Jim, Hans, Robert. These all look good. Much
appreciated.
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
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
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 t
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;
}
>>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 L&LD
Instructional Technology & M
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 no
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 L&LD
Instructional Technology & Media
Join the Bank of America Flash Platform Develo
9 matches
Mail list logo