Monthly Archives: December 2011

Upgrading/Migrating to Flash Builder 4.6 and AIR 3 (JSON)

Type 1120: Access of undefined property JSON

If you’re using as3corelib like I’ve been using for quite some time now, you will notice this error.  To fix it you simply need to remove the following import (it may vary based on your project structure):

import com.adobe.serialization.json.JSON;

 

and then you’ll need to modify your code to replace:

JSON.decode(myString);
and
JSON.encode(myObject);

to:

JSON.parse(myString);
and
JSON.stringify(myObject);

 

You can find the full details of the new implementation of the native JSON support in AS3 on Adobe’s Reference Site

 

Updating/Migrating to Flash Builder 4.6 and AIR 3.1

Namespace 2.6 in the application descriptor file should be equal or higher than the minimum version 3.1 required by Flex SDK.  Unknown AIR application.xml Problem

Easy fix, just change:
 <application xmlns="http://ns.adobe.com/air/application/2.6">
to:
 <application xmlns="http://ns.adobe.com/air/application/3.1">

 

If you’re updating from a version earlier than 4.5, please reference this post about upgading to 4.5