MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Uživatelský manuál Strana 55

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 80
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 54
Server-Side Communication ActionScript 55
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
Zobrazit stránku 54
1 2 ... 50 51 52 53 54 55 56 57 58 59 60 ... 79 80

Komentáře k této Příručce

Žádné komentáře