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

Save/Loading

Explorer ,
Dec 18, 2016 Dec 18, 2016

Good afternoon users, I have a question about creating a simple database for storing variable values in dynamic text:

// Var

score.text = "" + qnt_score.toString();

var so:SharedObject = SharedObject.getLocal("yourso", "/");

// Actions

You_Score += 1;

so.data.highscore = You_Score;

so.flush();

trace("Give a score!")

I tried to run this way, however, unsuccessfully, the score is not saved (or not loaded), the attempt was to make the score save automatically, and load from the click of a button.

Can anybody help me? I'm grateful now!

TOPICS
ActionScript
249
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

correct answers 1 Correct answer

Community Expert , Dec 18, 2016 Dec 18, 2016

how do you know it wasn't saved?

usually you'd use:

var so:...etc

if(so.data.highscore){

//do something.  eg, You_Score=so.data.highscore

} else {

You_Score=0;

}

Translate
Community Expert ,
Dec 18, 2016 Dec 18, 2016
LATEST

how do you know it wasn't saved?

usually you'd use:

var so:...etc

if(so.data.highscore){

//do something.  eg, You_Score=so.data.highscore

} else {

You_Score=0;

}

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