In a very simple first AIR application (I’m using Flash Builder 4.5), I am trying to accomplish the following on my MacBook:
- Read a local file (JSON format) into the AIR app.
- Parse through the file.
- Display some selected contents in a grid.
That’s it.
I’ve found an example that does some simple JSON parsing in Flex, but the problem is that it loads the JSON source from a remote web site.
So do I need to load any file-specific libraries to make this work in AIR? Or can I simply refer to the file by using the Mac file-path? I just want the local file to be the JSON source. The parsing is already taken care of.
You can use FileStream like:
Initializing a FileStream object, and opening and closing files