MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Manuale Utente Pagina 89

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 88
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
86
An event handler invoked when a shared object receives a message with the same name from the client-side
SharedObject.send() method. You must define a Function object and assign it to the event handler.
The
this keyword used in the body of the function is set to the shared object instance returned by
SharedObject.get().
If you dont want the server to receive a particular message, do not define this handler.
Availability
Flash Communication Server 1
Parameters
p1, ..., pN Optional parameters passed to the handler method if the message contains user-defined parameters.
These parameters are the user-defined objects that are passed to the
SharedObject.send() method.
Returns
Any return value is ignored by the server.
Example
The following example defines an event handler called
traceArgs:
var so = SharedObject.get("userList", false);
so.traceArgs = function(msg1, msg2){
trace(msg1 + " : " + msg2);
};
SharedObject.isDirty
so.isDirty
Read-only; a boolean value indicating whether a persistent shared object has been modified since the last time it was
stored (
true) or not (false). The SharedObject.commit() method stores shared objects with an isDirty
property that is
true.
This property is always
false for nonpersistent shared objects.
Availability
Flash Media Server 2
Example
The following example saves the
so shared object if it has been changed:
var so = SharedObject.get("foo", true);
if (so.isDirty){
SharedObject.commit(so.name);
}
SharedObject.lock()
so.lock()
Locks a shared object. This method gives the server-side script exclusive access to the shared object; when the
SharedObject.unlock() method is called, all changes are batched and one update message is sent through the
SharedObject.onSync() handler to all the clients that subscribe to this shared object. If you nest the
SharedObject.lock() and SharedObject.unlock() methods, make sure that there is an unlock() method for
every
lock() method; otherwise, clients are blocked from accessing the shared object.
Vedere la pagina 88
1 2 ... 84 85 86 87 88 89 90 91 92 93 94 ... 154 155

Commenti su questo manuale

Nessun commento