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

SharedObject data loss after reopening my ios app

Guest
Mar 04, 2015 Mar 04, 2015

Hi, I'm developing an app for ios devices and when I tested it on my iPhone the high-score data is lost everytime I restart (close and reopen) the application.

var shared: SharedObject = SharedObject.getLocal("myRecordObject");

if (shared.data.score) {

    record = shared.data.score;

}

scoreBar.recordField.text = record.toString();

.

.

.

function gameOver() {

.

.

.

    if (score > record) {

        record = score;

        shared.data.record = record;

        shared.flush();

        scoreBar.recordField.text = record.toString();

        scoreBar.adjust();

    }

}

TOPICS
ActionScript
142
Translate
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 ,
Mar 04, 2015 Mar 04, 2015
LATEST

try:

  1. var shared: SharedObject = SharedObject.getLocal("myRecordObject",'/'); 
Translate
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