[as3] how to save arrays data and retrieve it?

hi, I am having difficulty in trying to store the arrays,
let say I have 3 arrays to save

var firstA:Array=["a",1,2,3]
var secondA:Array=["a",1,2,3]
var fthirdA:Array=["a",1,2,3]

what I do to save the data

gameSave1={
"gsave1":firstA,
"gsave2":secondA,
"gsave3":thirdA,
}

idnet.submitUserData('gameSave1', JSON.stringify(gameSave1));

what I do to load

idnet.retrieveUserData('gameSave1');
firstA=gameSave1.gsave1
secondA=gameSave1.gsave2
thirdA=gameSave1.gsave3

everytime I replay the game, I can’t seem to load the file.
where did I do wrong? or is it because my game is in pending status?
please show me the correct example.
regards

Hi,

The saving looks correct. For loading try this,

    if (idnet.type == 'retrieve') {
        if (idnet.data.hasOwnProperty('error') === false) {
            var gamesave1 = JSON.parse(decodeURIComponent(idnet.data.jsondata));
        } else {
            trace('Error: '+idnet.data.error);
        }
    }

The if statement will go in the handleIDNET event as submitUserData is an asynchronous call.

hi, thank you… it works now.

Y8 Games