# Saving custom classes into SharedObject

**URL:** <https://forum.kirupa.com/t/saving-custom-classes-into-sharedobject/269270>\
**Category:** Uncategorized\
**Created:** [August 25, 2008, 2:50pm UTC](https://forum.kirupa.com/t/saving-custom-classes-into-sharedobject/269270 "2008-08-25T14:50:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BoppoBoy](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@BoppoBoy](https://forum.kirupa.com/u/BoppoBoy)\
**Post date:** [August 25, 2008, 2:50pm UTC](https://forum.kirupa.com/t/saving-custom-classes-into-sharedobject/269270/1 "2008-08-25T14:50:20Z")

</div>

Here’s what I’m trying to do: save a custom class (“CClass”, for example) into a shared object. After some forum-hunting, i found how to get the SharedObject class to store the data as the custom class, but when i pull the data from the SharedObject, all the values of my custom class are set to null.

Code for saving my class is:

```auto
registerClassAlias("CClass", CClass);
saveGameData = SharedObject.getLocal("saveSlot1");
saveGameData.data.myClass = myCClass; //myCClass is already defined, just not posted. 
saveGameData.flush();
saveGameData.close();

```

Now, before i close() the save data, if i put a breakpoint and check the values in the save data, my custom class values are displaying correctly. Now, when I load the shared object:

```auto
registerClassAlias("CClass", CClass);
//load data
            loadGameData = SharedObject.getLocal("saveSlot1");

```

If I place a breakpoint further down the code, and check loadGameData.data.myClass 's values, it is recognized and organized as my custom class, but all the values are set to null! any help?
