This should be simple, but google has failed me (more likely I didn't ask it nicely).
Using FlexBuilder 3, I just added code to do some JSON stuff. When I compile/debug from FlexBuilder everything works wonderful. When I try to compile using MXMLC I get the error "Access of undefined property JSON."
Some details;
In FlexBuilder I am using SDK - Flex 3.5.
The compile command line is:
mxmlc -load-externs=report.xml -warnings=false myModule.mxml
The import in the module is:
import com.adobe.serialization.json.JSON;
I suspect it is a library I need to include on the command line, but it eludes me.
Several years ago the ActionScript 3 standard library didn't include a native JSON parser and we had to import an external one manually. Nowadays the AS3 standard library has a prebuilt one that works almost exactly the same.
You have two options:
Download the as3corelib swc and put it into your
libsfolder inside your project.Overlay a recent version of the AIR SDK into your Flex SDK.
For the second step you need to download the AIR SDK from here, be very careful with the version you download. You need to download the AIR SDK for Flex developers.
Your Flex SDK is located inside the
sdksfolder where Flex Builder is installed.Once you download it, unzip it and merge all its contents with your Flex SDK folder (if asked to overwrite, choose Yes).
Don't forget to make a backup of your Flex SDK incase something goes wrong.