In AS2:
var Data:Number = 1763478912341234132;
trace ( Data.toString(16) ); //3afdd200
The same code in AS3 says "187922ba3afdd200" !!!
Where does "187922ba" come from ?
Printable View
In AS2:
var Data:Number = 1763478912341234132;
trace ( Data.toString(16) ); //3afdd200
The same code in AS3 says "187922ba3afdd200" !!!
Where does "187922ba" come from ?
What you're probably seeing in AS2 is the decimal number overflowing when it's converted and some bits just getting lost. 1763478912341234132 is 187922BA3AFDD1D4 in hex so the value you got from AS3 is wrong as well. It's only off by 44 though, which is pretty suspicious. The decimal number is only 62 bits so it shouldn't be overflowing.
Here in as3 I took from this operating system library I was working on a script to make fdd200 happen:
PHP Code:var temp_obj={}
function hexToRGB(hex){
var red =((hex & 0xFF0000) >> 16)
var green =((hex & 0x00FF00) >> 8)
var blue=((hex & 0x0000FF))
temp_obj={R:red,G:green,B:blue}
return(temp_obj);
}
function RGBtoHEX(r, g, b) {
var s = (r << 16 | g << 8 | b).toString(16);
while(s.length < 6) s="0"+s;
return s;
}
trace(RGBtoHEX(hexToRGB(1763478912341234132).R,hexToRGB(1763478912341234132).G,hexToRGB(1763478912341234132).B))
and some credit from here: https://stackoverflow.com/questions/...ert-rbg-to-hex