This content has been marked as final. Show 8 replies
Actionscript 3 does not support 64-bit Numbers.
Ok some of the documentation is starting to conflict.
In The Number Class itself it says that its a 53-Bit Integer.
In the Data type descriptions section of the Docs it says:
that the number class has 64 Available Bits, and can be used to hold a value larger than a 32-bit int/uint.
the values that are being screwed up are less than 1/4th of the size of a 64bit integer.
"By using some of its bits to store an exponent, the Number data type can store floating point numbers significantly larger than if it used all of its bits for the significand. For example, if the Number data type used all 64 bits to store the significand, it could store a number as large as 264. By using 11 bits to store an exponent, the Number data type can raise its significand to a power of 21023. "
I would suggest setting the resultType to "E4X" and just use the data in that format rather than converting to Object with the default decoder. It is a pity the source of the default xml decoder is private - it's not that difficult to write your own, though.
Yea it sucks that the source is private, I've even went into the debug mode and stepped into the Operation after it retrieved its results to see if I can change the default decoder and its also a private variable.
It would have been nice there was an interface and a way to add your own decoder was made available.
The problem is I have alot of classes here that mirrored the ones in C# that needed to hold a 64-bit ID value...
I ended up just sending it as a string...
There is - when you create the HTTPService, you can set the xmlDecode property to a function which takes an XMLNode :( and returns an object. You can convert the XMLNode to and XML by doing new XMLNode(XML.toXMLString) or something like that.
This is what I do - I have java classes that are mirrored in my AS classes, and I wrote my on encoder/decoder to implement the XStream serialization protocol in ActionScript.
Oops - sorry, forgot you're using SOAP.
Yea I just had to convert all of my 64bit Ints to Strings... I wish there was a way to create custom types that held 64-bits.