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

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 89
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
87
You cannot use the SharedObject.lock() method on proxied shared objects.
Availability
Flash Communication Server 1
Returns
An integer indicating the lock count: 0 or greater indicates success; -1 indicates failure. For proxied shared objects,
always returns -1.
Example
The following example locks the
so shared object, executes the code that is to be inserted, and then unlocks the
object:
var so = SharedObject.get("foo");
so.lock();
// Insert code here that operates on the shared object.
so.unlock();
SharedObject.mark()
so.mark(handlerName, p1, ..., pN)
Delivers all change events to a subscribing client as a single message.
In a server-side script, you can call the
SharedObject.setProperty() method to update multiple shared object
properties between a call to the
lock() and unlock() methods. All subscribing clients receive a change event
notification through the
SharedObject.onSync() handler. However, because the server may collapse multiple
messages to optimize bandwidth, the
change event notifications may not be sent in the same order as they were in
the code.
Use the
mark() method to execute code after all the properties in a set have been updated. You can call the
handlerName parameter passed to the mark() method, knowing that all property changes before the mark() call
have been updated.
Availability
Flash Media Server 2
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);
Vedere la pagina 89
1 2 ... 85 86 87 88 89 90 91 92 93 94 95 ... 154 155

Commenti su questo manuale

Nessun commento