# Help with shared objects

**URL:** <https://forum.kirupa.com/t/help-with-shared-objects/275794>\
**Category:** flash\
**Created:** [November 18, 2008, 6:38pm UTC](https://forum.kirupa.com/t/help-with-shared-objects/275794 "2008-11-18T18:38:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tie\_my\_rope](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@Tie\_my\_rope](https://forum.kirupa.com/u/Tie_my_rope)\
**Post date:** [November 18, 2008, 6:38pm UTC](https://forum.kirupa.com/t/help-with-shared-objects/275794/1 "2008-11-18T18:38:17Z")

</div>

Hi forum,

I’m trying to use a shared object to store a value. So far i have managed to store the value once a user has clicked on an image, and i can retrieve it. However i need to detect if its already there or not on page load. I have this code to do it:

```auto

so = SharedObject.getLocal("position");
text1 = so.data.pos_x;
if(so.data.pos_x != undefined){
   //perform this
}

```

…and it doesn’t work. The value displayed in text1 if the objected isn’t present is - undefined - but it still seems to completely ignore the logic. I’m new to actionscript could someone please give me an idea what might be wrong.
