# Saving Objects in a Shared Object

**URL:** <https://forum.kirupa.com/t/saving-objects-in-a-shared-object/322231>\
**Category:** flash\
**Created:** [May 15, 2011, 4:51am UTC](https://forum.kirupa.com/t/saving-objects-in-a-shared-object/322231 "2011-05-15T04:51:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![XDaccX](https://avatars.discourse-cdn.com/v4/letter/x/9fc29f/32.png) [@XDaccX](https://forum.kirupa.com/u/XDaccX)\
**Post date:** [May 15, 2011, 4:51am UTC](https://forum.kirupa.com/t/saving-objects-in-a-shared-object/322231/1 "2011-05-15T04:51:31Z")

</div>

Hello.  
First of all, if this has been posted before I apologize for opening a new thread but i can´t seem to find an answer to my problem.

I’m trying to save an object to a shared object, the thing is that while i run it the first time it works perfectly, but as soon as the swf is closed and re-opened my object just disappears.

If I’m not wrong this is because it’s a custom class instance and the .data saves a reference to the object instead of the object which is deleted as soon as the program closes.

My question is:

I’ve tried saving each var in a different data.[something], having to save five variables might not be bad but what about twenty or more.

Is there any way to save the instance rather than the reference or do I have to save each one of the variables in a different .data.[something]?
