MACROMEDIA FLASH MEDIA SERVER 2-CLIENT-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR FLASH MEDIA SERVER 2 Manual do Utilizador Página 148

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 172
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 147
145
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
A shared object property can be modified by a client between successive calls to SharedObject.getProperty() and
SharedObject.setProperty(). If you want to preserve transactional integrity, call the SharedObject.lock()
method before modifying the shared object; be sure to call
SharedObject.unlock() when you finish making
modifications. If you call
SharedObject.setProperty() without first calling SharedObject.lock(), the change is
made to the shared object, and all object subscribers are notified before
SharedObject.setProperty() returns. If
you call
SharedObject.lock() before you call SharedObject.setProperty(), all changes are batched and sent
when the
SharedObject.unlock() method is called. The SharedObject.onSync() handler on the client side is
invoked when the local copy of the shared object is updated.
Note: If only one source (whether client or server) is updating a shared object in a server-side script, you don’t need to use
the
lock() or unlock() method or the onSync() handler.
Availability
Flash Communication Server 1
Parameters
name The name of the property in the shared object.
value An ActionScript object associated with the property, or null to delete the property.
Example
The following example uses the SharedObject.setProperty() method to create the city property with the value
San Francisco. It then enumerates all the property values in a for loop and calls trace() to display the values.
myInfo = SharedObject.get("foo");
var addr = myInfo.getProperty("address");
myInfo.setProperty("city", "San Francisco");
var names = sharedInfo.getPropertyNames();
for (x in names){
var propVal = sharedInfo.getProperty(names[x]);
trace("Value of property " + names[x] + " = " + propVal);
}
See also
SharedObject.getProperty()
SharedObject.size()
so.size()
Returns the total number of valid properties in a shared object.
Availability
Flash Communication Server 1
Returns
An integer indicating the number of properties.
Example
The following example gets the number of properties of a shared object and assigns that number to the variable len:
Vista de página 147
1 2 ... 143 144 145 146 147 148 149 150 151 152 153 ... 171 172

Comentários a estes Manuais

Sem comentários