Copy link to clipboard
Copied
I am working on an app, and I want to be able to save the users progress, some of the things I might want to store are these variables:
GlobalVar.vars.coins (string)
GlobalVar.vars.blueUnlocked (boolean)
GlobalVar.vars.triangleUnlocked (boolean)
GlobalVar.vars.background1Unlocked (boolean)
GlobalVar.vars.highScore (string)
And a few others, I would like to save these to an easily readable file onto the SD card or phone storage, and possible save it as an encrypted file type so that users cannot simply change values. If someone can please help me that would be great. I also need help reading from these files when the game starts.
Copy link to clipboard
Copied
using a sharedobject is the easiest to implement solution.
Copy link to clipboard
Copied
How does one use sharedobject?
Copy link to clipboard
Copied
var so:SharedObject= SharedObject.getLocal("/");
if(so.data.coins){
// do whatever. your so has data from a previous save);
}
.
.
.
if you want to save the coins value to your so:
so.data.coins=GlobalVar.vars.coins;
so.flush();