Copy link to clipboard
Copied
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!
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;
}
Copy link to clipboard
Copied
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;
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now