I have blogged about JSON before but forgot to provide an example for getting JSON into AS. I saw a query on FlexIndia on JSON, so I thought I’ll post it now. The problem is to convert JSON to ActionScript Objects (or ASON). You can first try the demo application to see if this is what you are looking for…
- Application Demo
- Source Code (JSONTest.mxml)
In the app, you can either paste a URL (provided you have the security permissions) of a JSON to convert or paste your own JSON into the textarea and convert it.
This is what you need to do to get this working…
- Go to AS3CoreLib on Google Code and download the corelib-.90.zip file and extract it
- Get the corelib.swc from the /bin directory
- Download the app source or write your own code
- Do one of the following:
If you are using FlexBuilder:- Right click on your project go to Properties
- Navigate to Flex Build Path -> Libraries Tab -> Add SWC
- Now add the corelib.swc to your project
- Confirm that you have the line “import com.adobe.serialization.json.JSON;” in the code
- Run and Have Fun
If you are using the command-line compiler:
- Place the swc in the directory of your mxml code
- Confirm that you have the line “import com.adobe.serialization.json.JSON;” in the code
- Type the following on the command line
- mxmlc -include-libraries=corelib.swc JSONTest.mxml
- Run and Have Fun


Hi ,
Thanks for your help.It really works fine. Thanks once again
No problem… A pleasure
[...] I used the as3corelib to convert the JSON to an AS Object. I then embedded an Indic Font into my App and used it to render the text. The result is what you [...]
[...] Effects by Alex Uhlmann in this example. So be sure to compile the source code with the SWC (check this post if you don’t know how to compile in an external swc into your [...]
Thank you, with this can resolve a problem intallations Json, and now all is working
thx
Raghu, how do you access data from an external JSON feed? I’m new to Flex. I know about the crossdomain.xml file, which I’m including in the directory on my localhost but it doesn’t seem to work.
hi,
am very new to Flex , your blog helped me to fix the error.
thanx
remya
Hi,
Thank you very much…
I searched more than hour for the below error
“1172: Definition com.adobe.serialization.json:JSON could not be found.”
I followed your guidelines, now its working for me.
thanks again.