MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Manuel d'utilisateur Page 63

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 80
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 62
Server-Side Communication ActionScript 63
Description
Method; updates the value of a property in a shared object. A shared object property can be
modified by another user of the shared object between successive calls to
SharedObject.getProperty and SharedObject.setProperty. If you want to preserve
transactional integrity, call the
SharedObject.lock method before operating on the shared
object; be sure to call
SharedObject.unlock when the operations finish. If you dont call
SharedObject.lock and the SharedObject.setProperty is called, the change is made to the
shared object, and all subscribers of the object are notified before
SharedObject.setProperty
returns. If a call to the
SharedObject.lock method precedes a call to
SharedObject.setProperty, all changes are batched and sent when the SharedObject.unlock
method is called.
If you call
SharedObject.setProperty on the server side, it invokes a change message in the
SharedObject.onSync method on the client side for any Flash Player client that is using the
shared object. The
name parameter on the server side is the same as an attribute of the data
property on the client side. For example, the following two lines of code are equivalent: the first
line is server-side ActionScript, and the second is client-side ActionScript:
sharedInfo.setProperty(nameVal, "foo");
clientSO.data[nameVal] = "foo";
Example
This example uses the SharedObject.setProperty method to create the property city with the
value San Francisco. It then enumerates all the property values in a for loop and prints out the
results in the Output window by using a
trace action.
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
Availability
Flash Communication Server MX.
Usage
mySharedObject.size()
Parameters
None.
Returns
An integer indicating the number of properties.
Description
Method; returns the total number of valid properties in a shared object.
Vue de la page 62
1 2 ... 58 59 60 61 62 63 64 65 66 67 68 ... 79 80

Commentaires sur ces manuels

Pas de commentaire