
140
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
Parameters
handlerName Calls the specified handler on the client-side SharedObject instance. For example, if the handlerName
parameter is
onChange, the client invokes the SharedObject.onChange() handler with all the p1, ...,pN
parameters.
Note: Do not use a built-in method name for a handler name. For example, if the handler name is close, the subscribing
stream will be closed.
p1, ..., pN Parameters of any ActionScript type, including references to other ActionScript objects. Parameters are
passed to
handlerName when it is executed on the client.
Returns
A boolean value. Returns true if the message can be dispatched to the client; otherwise, false.
Example
The following example calls the mark() method twice to group two sets of shared object property updates for clients:
var myShared = SharedObject.get("foo", true);
myShared.lock();
myShared.setProperty("name", "Stephen");
myShared.setProperty("address", "Xyz lane");
myShared.setProperty("city", "SF");
myShared.mark("onAdrChange", "name");
myShared.setProperty("account", 12345);
myShared.mark("onActChange");
myShared.unlock();
The following example shows the receiving client-side script:
connection = new NetConnection();
connection.connect("rtmp://flashmediaserver/someApp");
var x = SharedObject.get( "foo", connection.uri, true);
x.connect(connection);
x.onAdrChange = function(str) {
// Shared object has been updated,
// can look at the "name", "address" and "city" now.
}
x.onActChange = function(str) {
// Shared object has been updated,
// can look at the "account" property now,
}
SharedObject.name
so.name
Read-only; the name of a shared object.
Availability
Flash Communication Server 1
Komentarze do niniejszej Instrukcji