Howdy all,
I’m working on the high scores area of my game atm, the highscores themselves are working fine but i’m trying to save them for the next time they locally run the game. I’ve never used shared objects before but i had a look at a few tutorials and this is what i got;
On the main frame i have:
highscores = SharedObject.getLocal("highscore_data");
to make the shared object.
I have a function that is run every second as a countdown;
function countDown() {
timer.text--;
if (timer.text<=0) {
clearInterval(counter);
_root["highscores.data.score"+score_num] = score;
highscores.data.name = char_name_var;
highscores.flush();
trace(score_num);
trace(_root["highscores.data.score"+score_num]);
score_num++;
}
this supposedly creates the data for the shared object and then saves it,
the last thing i have for it is;
for(g=0;g<10;g++) {
_root.scores_array[g] = _root["highscores.data.score"+g];
}
to set the scores from the shared object into the array so that it can be sorted and assigned to its place.
The problem though is that it isn’t saving any of the data, is there a way to check if the shared object file is being created? like on the HDD itself? if anyone has any ideas theyd be greatly appreciated.
Thankyou
-Warheart