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

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 85
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
83
Returns
A boolean value of
true if successful; otherwise, false.
Example
The following example places a reference to the shared object
foo in the variable so. It then locks the shared object
instance so that no one can make any changes to it and saves the shared object by calling
so.flush(). After the
shared object is saved, it is unlocked so that further changes can be made.
var so = SharedObject.get("foo", true);
so.lock();
// Insert code here that operates on the shared object.
so.flush();
so.unlock();
SharedObject.get()
SharedObject.get(name, persistence [, netConnection])
Static; creates a shared object or returns a reference to an existing shared object. To perform any operation on a
shared object, the server-side script must get a reference to the shared object by using the
SharedObject.get()
method. If the requested object is not found, a new instance is created.
Availability
Flash Communication Server 1
Parameters
name Name of the shared object instance to return.
persistence A boolean value: true for a persistent shared object; false for a nonpersistent shared object. If no
value is specified, the default value is
false.
netConnection A NetConnection object that represents a connection to an application instance. You can pass this
parameter to get a reference to a shared object on another server or a shared object that is owned by another appli-
cation instance. All update notifications for the shared object specified by the
name parameter are proxied to this
instance, and the remote instance notifies the local instance when a persistent shared object changes. The NetCon-
nection object that is used as the
netConnection parameter does not need to be connected when you call
SharedObject.get(). The server connects to the remote shared object when the NetConnection state changes to
connected. This parameter is optional.
Returns
A reference to an instance of the SharedObject class.
Details
There are two types of shared objects, persistent and nonpersistent, and they have separate namespaces. This means
that a persistent and a nonpersistent shared object can have the same name and exist as two distinct shared objects.
Shared objects are scoped to the namespace of the application instance and are identified by a string. The shared
object names should conform to the URI specification.
Vedere la pagina 85
1 2 ... 81 82 83 84 85 86 87 88 89 90 91 ... 154 155

Commenti su questo manuale

Nessun commento