
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
85
SharedObject.getProperty()
so.getProperty(name)
Retrieves the value of a named property in a shared object. The returned value is a copy associated with the property,
and any changes made to the returned value do not update the shared object. To update a property, use the
Share-
dObject.setProperty()
method.
Availability
Flash Communication Server 1
Parameters
name A string indicating the name of a property in a shared object.
Returns
The value of a SharedObject property. If the property doesn’t exist, returns
null.
Example
The following example gets the value of the
name property on the user shared object and assigns it to the firstName
variable:
firstName = user.getProperty("name");
See also
SharedObject.setProperty()
SharedObject.getPropertyNames()
so.getPropertyNames()
Enumerates all the property names for a given shared object.
Availability
Flash Communication Server 1
Returns
An array of strings that contain all the property names of a shared object.
Example
The following example calls
getPropertyNames() on the myInfo shared object and places the names in the names
variable. It then enumerates those property names in a
for loop.
myInfo = SharedObject.get("foo");
var addr = myInfo.getProperty("address");
myInfo.setProperty("city", San Francisco");
var names = myInfo.getPropertyNames();
for (x in names){
var propVal = myInfo.getProperty(names[x]);
trace("Value of property " + names[x] + " = " + propVal);
}
SharedObject.handlerName()
so.handlerName = function([p1,..., pN]){}
Commenti su questo manuale