Wednesday, April 6, 2011

how to store multiple objects in flex sharedlocalobject?

I have a project where the client can save data from a flex app to their client in xml , something like

<xml>
<project id='1111'>
<data ... />
<data ... />
</project>
</xml>

this is stored on the flex sharedlocalobject , but if the client creates a new project it overwrites the existing project. How can i store multiple projects in the sharedlocalobject?

From stackoverflow
  • The data attribute of a shared object can store arbitrary number of values like this:

    var so:SharedObject = SharedObject.getLocal("sharedObject");
    so.data.one = 1;
    so.data.two = 2;
    ...
    

    So in your case, you could simply store each project XML in a separate "attribute" of the data object.

    Rick J : wow that looks like exactly what i was looking for .... thanks for your help!

0 comments:

Post a Comment