Topic: Parsing JSON in actionscript 2.0

Has anyone tried to parse a JSON for any application on the chumby?
I am having trouble with parsing a json string in actionscript.

Re: Parsing JSON in actionscript 2.0

There are several AS2 JSON parsing scripts out there, but note that the performance is pretty poor if you're attempting to parse very large strings.

I had one widget that had to consume a very large JSON response, and it took so long on the device that I would get an "Actionscript Timeout" message.  The way I got around it was to perform some simple string manipulation to narrow it down to just the part I wanted, then did a couple more transformations to turn most of it into XML, then threw that at the XML parser, then pulled out what I needed.

3 (edited by Ketaki 2009-11-08 20:22:06)

Re: Parsing JSON in actionscript 2.0

Oh ok! Thanks for the information.
Well, for my application, I am trying to access a RESTful web service.
But for getting to the web service, I need to authenticate using webauth (https://webauth.gatech.edu/about.html)
So, my request gets redirected to my service through this URL, hence LoadVars / XML object does not forward my request headers to the web service.

If my web service somehow gets my "accept" header, it can return me an XML file.
Does anyone know any workaround for this?

Re: Parsing JSON in actionscript 2.0

Hmmm, at this point, it would seem your problem is just getting data from this service in the first place, not parsing it.

As I recall, WebAuth is very browser-focused and is a tough nut to crack for anything else that happens to also use HTTP.  I'm afraid I don't know enough about it to assist in poking through it to get to your service.