MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Specifiche Pagina 347

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 369
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 346
Server-Side Communication ActionScript 47
Example
This example creates a shared object named foo inside the function onProcessCmd. The function
is passed a parameter,
cmd, that is assigned to a property in the shared object.
function onProcessCmd(cmd){
// insert code here
var shObj = SharedObject.get("foo", true);
propName = cmd.name;
shObj.getProperty (propName, cmd.newAddress);
}
The following example uses a proxied shared object. A proxied shared object resides on a server or
in an application instance (called master) that is different than the server or application instance
that the client connects to (called proxy). When the client connects to the proxy and gets a remote
shared object, the proxy connects to the master and gives the client a reference to this shared
object. The following code is in the main.asc file:
application.appStart = function() {
nc = new NetConnection();
nc.connect("rtmp://" + master_server + "/" + master_instance);
proxySO = SharedObject.get("myProxy",true,nc);
// Now, whenever the client asks for a persistent
// shared object called myProxy they will receive myProxy
// shared object from the master_server/master_instance
}
SharedObject.getProperty
Availability
Flash Communication Server MX.
Usage
mySharedObject.getProperty(name)
Parameters
name The name of the property in the shared object.
Returns
The value of a SharedObject property.
Description
Method; retrieves the value of a named property in a shared object. The returned value is a copy
associated with the property, and any changes made to the returned value do not update the
shared object. To update a property, use the
SharedObject.setProperty method.
Example
The following example gets the value of the name property and passes it to the value variable:
value = sharedInfo.getProperty(name);
See also
SharedObject.setProperty
Vedere la pagina 346
1 2 ... 342 343 344 345 346 347 348 349 350 351 352 ... 368 369

Commenti su questo manuale

Nessun commento