• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Save/Load game in Air for Android AS3

Explorer ,
Apr 19, 2014 Apr 19, 2014

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.

TOPICS
ActionScript

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 19, 2014 Apr 19, 2014

Copy link to clipboard

Copied

using a sharedobject is the easiest to implement solution.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 19, 2014 Apr 19, 2014

Copy link to clipboard

Copied

How does one use sharedobject?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 20, 2014 Apr 20, 2014

Copy link to clipboard

Copied

LATEST

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();

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines