ForumsProgramming ForumAS2 multi saving help

3 3394
rino
offline
rino
27 posts
Nomad

I am making a that needs multi saving but i have been unable to get the code I am using to save more then one variable.

ON THE FRAME:

var savefile = SharedObject.getLocal("yourgamename"
_root.oldscore = savefile.data.score;
_root.oldlevel = savefile.data.level;
if(savefile.data.score==undefined){
_root.oldscore=0;
_root.oldlevel=0;
}

ON THE SAVE BUTTON:
on (press){
savefile.data.score=_root.score;
savefile.data.level=_root.level;
savefile.flush();
}


ON THE LOAD BUTTON:

on (press){
var savefile = SharedObject.getLocal("yourgamename"
if(savefile.data.score==undefined){
_root.score=0;
_root.level=0;
}else{
_root.score=savefile.data.score;
_root.level=savefile.data.level;
}
}

  • 3 Replies
rino
offline
rino
27 posts
Nomad

nevermind I have solved the problem

PixelSmash
offline
PixelSmash
566 posts
Nomad

So, what was the problem exactly? More for future reference than anything

rino
offline
rino
27 posts
Nomad

how to change the code so that it would save multi scores

Showing 1-3 of 3