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();
}
}
Copy link to clipboard
Copied
try: