I’m trying to load some WDDX data into a shared object, but I’m having some troubles getting it back out…
I can open the sol file in a text editor and see that my data is in there, but I can’t manage to access it… does putting information into a sharedObject change things? Can you load an array into a sharedObject and have it retain it’s array-ed-ness?
Further details may be furnished upon request! Thanks in advance!
You can’t store an array into a shared object… but you can create a string from the array by using the [font=courier new]Array.join()[/font] method, store the string into the shared object, and then use the [font=courier new]String.split()[/font] method to create an array from the string.
Confused? Here’s an example:
// store it
var my_array = [1, 2, 3, 4, 5];
var my_so = SharedObject.getLocal("my_so");
my_so.data.my_str = my_array.join();
my_so.flush();
// retrieve it
var my_so = SharedObject.getLocal("my_so");
var my_array = my_so.data.my_str.split(",");