# AS2 multi saving help

**URL:** <https://forum.kirupa.com/t/as2-multi-saving-help/294612>\
**Category:** Uncategorized\
**Created:** [August 17, 2009, 3:21pm UTC](https://forum.kirupa.com/t/as2-multi-saving-help/294612 "2009-08-17T15:21:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rino](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@rino](https://forum.kirupa.com/u/rino)\
**Post date:** [August 17, 2009, 3:21pm UTC](https://forum.kirupa.com/t/as2-multi-saving-help/294612/1 "2009-08-17T15:21:25Z")

</div>

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;  
}  
}
