User Guide
SharedObject class 137
Example
The following example calls the SharedObject.send() method to execute the
doSomething() method in the client-side ActionScript and passes doSomething() the string
"this is a test":
var myShared = SharedObject.get("foo", true);
myShared.send("doSomething", "this is a test");
The following example is the client-side ActionScript code that defines the doSomething
method:
connection = new NetConnection();
connection.connect("rtmp://www.macromedia.com/someApp");
var x = SharedObject.getRemote("foo", connection.uri, true);
x.connect(connection);
x.doSomething = function(str) {
// Process the str object.
};
SharedObject.setProperty()
Availability
Flash Communication Server MX 1.0.
Usage
mySO.setProperty(name, value)
Parameters
name The name of the property in the shared object.
value An ActionScript object associated with the property, or null to delete the property.
Returns
Nothing.
Description
Method; updates the value of a property in a shared object.
The
name parameter on the server side is the same as an attribute of the data property on the
client side. For example, the following two lines of code are equivalent; the first line is server-
side ActionScript, and the second is client-side ActionScript:
mySO.setProperty(nameVal, "foo");
clientSO.data[nameVal] = "foo";