# Saving and loading data. How?

**URL:** <https://forum.kirupa.com/t/saving-and-loading-data-how/54411>\
**Category:** Uncategorized\
**Created:** [June 14, 2004, 2:12pm UTC](https://forum.kirupa.com/t/saving-and-loading-data-how/54411 "2004-06-14T14:12:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boondogger](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@Boondogger](https://forum.kirupa.com/u/Boondogger)\
**Post date:** [June 14, 2004, 2:12pm UTC](https://forum.kirupa.com/t/saving-and-loading-data-how/54411/1 "2004-06-14T14:12:00Z")

</div>

I’ve searched load of threads for info on this because for what I’m doing I need to save data to the local disk and then load it back up again as required. I’m using a local shared object to save data to and this works fine. Getting it back out again seems less straightforward. This is the code I’m using:

//Saving  
myLocal\_so = sharedobject.getLocal(“flashcookie”,"/");  
datastring = “anyoldstuff”;//sample data to save   
myLocal\_so.data.savegame = datastring;  
myLocal\_so.flush();  
//Loading  
myLoadVars = new LoadVars();  
myLoadVars = myLocal\_so.data.savegame;  
myLoadVars.onLoad = function(success) {  
if (success) {loadgame = myLocal\_so.data.savegame;  
trace (myLocal\_so.data.savegame);}  
else {trace (“Error!”);}  
}

Nothing appears to happen at all. The program continues with no traced output at all.  
Can anyone tell me where I am going wrong with this?

Thanks
