Skip to main content
Known Participant
September 22, 2012
Question

Saving multiple arrays with applicationStorageDirectory

  • September 22, 2012
  • 7 replies
  • 2106 views

Im having trouble even finding a simple example I can work with.

I want to save multiple arrays with applicationStorageDirectory. Im using Flash Pro and it's air for ios. How would I go about writing data and then reading from the arrays?

Example array would be like this:

var exampleArray:Array = [ArrayOne,ArrayTwo,ArrayThree];

I have this working with LSO on the computer, but on mobile it doesnt work-im guessing the size limit is too much (64 arrays with 190 entries on each) so I want to use applicationStorageDirectory.

Id appreciate the help. Thanks.

This topic has been closed for replies.

7 replies

September 22, 2012

You should try out JSON: http://www.json.org/
It makes a JSON-Object out of an AS3 Array (basicly makes a String, wich you can save in the db).
Then you can read it back in and parse/decrypt it back to an Array.
More info here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/JSON.html

Known Participant
September 22, 2012

Is this the only way it can be done? Im new to programming and it seems a little advanced

September 22, 2012

well it's not as hard as it sounds. If you can save it localy to a txt file or a database, you can do it.
To read it in you just use this one line: jsonArray = JSON.decode( loader.data ) and you have your Array.
To encode it, it's just as simple.