February 6th, 2012

Adobe added native support for JSON in Flash 11, which was released a few months ago. I’ve added a new argument to the blocking JSON functions (decodeJson and encodeJson) that will use native JSON if it is available.

Basically, this allows anyone who wants to get a free speed boost among Flash 11 users, while still staying compatible (and fast) amongst users still using Flash 9 and 10. Read the documentation in encodeJson.as and decodeJson.as for more information on compatibility differences.

As much as I hate to say it, projects targeting Flash 11+ should not use blocking JSON functions. While they are still very fast, AS3 can’t compete with native code, and libraries like actionjson should only be used when necessary. There’s still no equivalent to the asynchronous JSON encoder and decoder, so they’re still useful, although this will also likely change with the release of Actionscript Workers.