Using JSON
16 December 2005 at 6:26 pm
Been using the actionscript JSON class from JSON.org and found a bug in the implementation. If you’re getting exponential numbers from your JSON service, an error is thrown. Something like this will cause you grief:
{ "bigNumber":1.513e8 }
Found a way to bypass this, but using such numbers severely affects the stability of Flash 8. I’ve had Flash 8 disappear instantly after compiling code with such numbers. For some reason, this gets better after you save your file? No idea why, but it’s a thing to look out for.
My rewite is really simple. On line 268 (number-function) I’ve added this:
while (this.next() && (ch>='0' && ch<='9') || ch=='E' || ch=='e' || ch=='-' || ch=='+') {