# Using Cookies (non-edible)

**URL:** <https://forum.kirupa.com/t/using-cookies-non-edible/205815>\
**Category:** programming\
**Created:** [November 2, 2006, 5:56am UTC](https://forum.kirupa.com/t/using-cookies-non-edible/205815 "2006-11-02T05:56:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Holmesc](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@Holmesc](https://forum.kirupa.com/u/Holmesc)\
**Post date:** [November 2, 2006, 5:56am UTC](https://forum.kirupa.com/t/using-cookies-non-edible/205815/1 "2006-11-02T05:56:27Z")

</div>

Hello! I am working on a game that is too long to be played at one time. At this point, I Want to use a save system rather than passwords. I found a tutorial that gives this code:  
AC for the save button:

```auto
on (release) {
_root.pos = sharedobject.getLocal("COOKIE NAME");
_root.pos.data.guy = _root.guy._x;
_root.pos.data.guy = _root.guy._y;
_root.pos.data.NAME = _root.NAME;
} 

```

AC for the load button:

```auto
on (release) {
_root.pos = sharedobject.getLocal("COOKIE NAME");
setProperty(_root.guy, _x, _root.pos.data.guyx);
setProperty(_root.guy, _y, _root.pos.data.guyy);
_root.NAME = _root.pos.data.NAME;
}

```

This code is supposed to create a cookie ("COOKIE NAME) that holds, asuuming your character’s instance name is ‘guy’,  
variables holding the guy’s \_x and \_y called guyx and  
guyy (respectively), and a variable holding the player’s name called NAME. Now, the problem at hand here is that whenever I hit the load button, it comes up undefined. I have no idea why, please help!!!
