MACROMEDIA FLASH MEDIA SERVER 2-CLIENT-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR FLASH MEDIA SERVER 2 Manuel d'utilisateur Page 141

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 172
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 140
138
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
myInfo = SharedObject.get("foo");
var addr = myInfo.getProperty("address");
myInfo.setProperty("city", "San Francisco");
var names = myInfo.getPropertyNames();
for (x in names){
var propVal = myInfo.getProperty(names[x]);
trace("Value of property " + names[x] + " = " + propVal);
}
SharedObject.handlerName()
so.handlerName = function([p1,..., pN]){}
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 don’t 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:
Vue de la page 140
1 2 ... 136 137 138 139 140 141 142 143 144 145 146 ... 171 172

Commentaires sur ces manuels

Pas de commentaire