Macromedia flash media server 2-client-side actionscript language reference for flash media server 2 ユーザーズマニュアル

ページ / 156
124
Client-Side ActionScript Language Reference
For a remote shared object, calling 
in the client-side ActionScript 
file flushes the object only on the client, not the server. The following example shows how a 
server-side script can flush a remote shared object on the server:
// This is a SERVER-SIDE script, not ActionScript.
// Get the shared object when the application is loaded.
application.onAppStart = function(){
application.my_so = SharedObject.get("SharedObjName", true);
}
// When a user disconnects, flush the shared object.
application.onDisconnect = function(client){
application.my_so.flush();
}
/* You can also set a timer to periodically flush the shared object
onto the hard disk on the server. */
application.onAppStart = function(){
application.my_so = SharedObject.get("SharedObjName", true);
setInterval(function() { application.my_so.flush(); }, 60000);
}
See also
SharedObject.getLocal()
Availability
Flash Player 6.
Flash Media Server (not required).
Usage
SharedObject.getLocal(name [, localPath][, secure])
Parameters
name
  A string value that represents the name of the object. The name can include forward 
slashes (
/
); for example, 
work/addresses
 is a legal name. Spaces are not allowed in a shared 
object name, nor are the following characters: 
~ % & \ ; :  " ' , < > ? # 
NO
T
E
The correct syntax is 
SharedObject.getLocal()
. To assign the object to a variable, use 
syntax like 
var myLocal_so:SharedObject 
SharedObject.getLocal(objectName)
.