# Saving and lodaing flash game

**URL:** <https://forum.kirupa.com/t/saving-and-lodaing-flash-game/310811>\
**Category:** programming\
**Created:** [June 20, 2010, 6:38am UTC](https://forum.kirupa.com/t/saving-and-lodaing-flash-game/310811 "2010-06-20T06:38:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![overlordlink](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@overlordlink](https://forum.kirupa.com/u/overlordlink)\
**Post date:** [June 20, 2010, 6:38am UTC](https://forum.kirupa.com/t/saving-and-lodaing-flash-game/310811/1 "2010-06-20T06:38:49Z")

</div>

Ok well… my idea here is to have a save button that saves you data, or an auto save function either one. Then when you start your game, have a load button that loads the data and takes you to the corresponding level.

For the save button code I have this.

```auto

on(release){
savefile.data.levelnum= _root.levelnum;
savefile.flush();
}

```

And the load button code is.

```auto

on(release){
var savefile = SharedObject.getLocal("test");
_root.levelnum = savefile.data.levelnum;
}
if (savefile.data.levelnum == undefined ){ 
_root.gotoAndStop("level1")

```

Now the only problem with this is I don’t know how to actually implement it. For instance it saving the levelnum equal to 4 then when it loads having it go to the fourth level.
