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

SharedObject data loss after reopening my ios app

Guest
Mar 04, 2015 Mar 04, 2015

Copy link to clipboard

Copied

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

Views

132

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 ,
Mar 04, 2015 Mar 04, 2015

Copy link to clipboard

Copied

LATEST

try:

  1. var shared: SharedObject = SharedObject.getLocal("myRecordObject",'/'); 

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