flash (macromedia):
Hello,
In short, is it possible to create a custom class with a data
structure and a couple of functions that can be later referred to
after being loaded from disk via SharedObject?
-- The detailed question --
I'm relatively new to the OO in ActionScript so please bare with me.
I've created a program that has a few custom classes I've made using
separate .as files for each class. I've been using these without too
many problems until recently. It's now apparent that I need to start
saving some persistent data using the local SharedObject capabilities
that MX provides.
I'm struggling with the objects that I get back from the SharedObject.
It seems that I cannot refer to any of the custom classes functions
once they've been saved to disk with the SharedObject. For instance,
I have a getName() function in custom class called Player. If I refer
to so.data.player.getName() after I've pulled it out of the
so.data.player object I get undefined back. If I refer to the name
var directly in the player object like so.data.player.name I get the
expected output.
Either my custom class functions get stripped away when the Player
object is saved in the SharedObject (Limitation of what can be saved
to the SO?) or I'm doing something wrong when I create my custom class
(although it works outside of the SO). Perhaps I have to cast the
Object passed back from the SO before I try to run it's specific
functions, (if so, then how do I cast the object to my custom class)?
I can post code but didn't want to add to an already long message.
Thanks,