
10
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
Example
The following server-side code sends a message to the client:
application.broadcastMsg("serverMessage", "Hello Client");
The following client-side ActionScript 2.0 code handles the message and outputs “Hello Client”:
nc = new NetConnection();
nc.serverMessage = function(msg){
trace(msg);
};
The following client-side ActionScript 3.0 code handles the message and outputs “Hello Client”:
var nc:NetConnection = new NetConnection()
var ncClient = new Object();
nc.client = ncClient;
ncClient.serverMessage = nc_serverMessage;
function nc_serverMessage(msg:String):void{
trace(msg);
}
application.clearSharedObjects()
application.clearSharedObjects(soPath)
Deletes persistent shared objects files (FSO files) specified by the soPath parameter and clears all properties from
active shared objects (persistent and nonpersistent). Even if you have deleted all the properties from a persistent shared
object, unless you call
clearSharedObjects(), the FSO file still exists on the server.
Availability
Flash Communication Server 1
Parameters
soPath A string indicating the Uniform Resource Identifier (URI) of a shared object.
The soPath parameter specifies the name of a shared object, which can include a slash (/) as a delimiter between
directories in the path. The last element in the path can contain wildcard patterns (for example, a question mark [?]
and an asterisk [*]) or a shared object name. The
application.clearSharedObjects() method traverses the shared
object hierarchy along the specified path and clears all the shared objects. Specifying a slash (/) clears all the shared
objects that are associated with an application instance.
If soPath matches a shared object that is currently active, all its properties are deleted, and a clear event is sent to all
subscribers of the shared object. If it is a persistent shared object, the persistent store is also cleared.
The following values are possible for the soPath parameter:
• / clears all local and persistent shared objects associated with the instance.
• /foo/bar clears the shared object /foo/bar; if bar is a directory name, no shared objects are deleted.
• /foo/bar/* clears all shared objects stored under the instance directory /foo/bar. If no persistent shared objects
are in use within this namespace, the bar directory is also deleted.
• /foo/bar/XX?? clears all shared objects that begin with XX, followed by any two characters. If a directory name
matches this specification, all the shared objects within this directory are cleared.
Kommentare zu diesen Handbüchern