Skip to main content
Participant
Jun 25, 2012 4:18 PM UTC
Answered

Save a variable on iOS

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 is closed to new replies. Start a new post to keep the conversation going.
vabhatiaCorrect answer
Adobe Employee
Jun 25, 2012 4:54 PM UTC

3 replies

Mark.fromOP
Inspiring
Jun 26, 2012 7:55 AM UTC

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/

Translate
vabhatiaCorrect answer
Adobe Employee
Jun 25, 2012 4:54 PM UTC
Colin Holgate
Inspiring
Jun 25, 2012 4:22 PM UTC

Just using a sharedobject should work ok.

Translate