I want to have a function that one can call to save a name/value into
the clientside SharedObject.
The Flex doc has the example like this:
var my_so:SharedObject = SharedObject.getLocal("superfoo");
my_so.data.itemNumbers = items_array;
my_so.data.adminPrivileges = currentUserIsAdmin;
my_so.data.userName = currentUserName;
My issue is that I don't want to hard code the name of the cookie. So
in the above example, I don't want to hardcode "itemNumbers".
Here is what I want to do:
public function saveCookie(key:String, value:String):void {
var my_so:SharedObject = SharedObject.getLocal("superfoo");
my_so.data.key = value;
}
The problem is that "data.key" is not evaluated to its real parameter
value and the cookie is saved as the hard coded "key" string.
Any ideas? Thanks!