Skip to main content
Participant
June 25, 2012
Answered

Save a variable on iOS

  • June 25, 2012
  • 3 replies
  • 783 views

What's the absolute easiest way to save a single variable in an AIR for iOS app made in Flash? All I want to save is the user's highest score. I have Googled around and people always try to bring databases and such into it which seems like overkill. I just want the variable to be accessible again if the user closes the app and reopens it. Any ideas? This is my first iOS app so the simpler the solution, the better!

This topic has been closed for replies.

3 replies

Mark.fromOP
Inspiring
June 26, 2012

Yes shared objects is the way to go. However anytime you create an update for your app make sure your swf is the same exact name so do this.

Do:

v1.0

name: mygame.fla (publish it out)

v1.1

name: mygame.fla (same as v1.0)

Dont:

v1.0

name: mygameV1p0.fla

v1.1

name: mygameV1p1.fla

Doing it the Dont way will not carry over the variables from update to update, however doing it the Do way will. hope that helps.

This tutorial might be easier than the adobe docs.

http://www.republicofcode.com/tutorials/flash/as3sharedobject/

vabhatiaCorrect answer
Adobe Employee
June 25, 2012
Colin Holgate
Inspiring
June 25, 2012

Just using a sharedobject should work ok.