MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Manuale Utente Pagina 44

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 43
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
41
output += errorVal.code + " error occurred";
};
}
The sum() method can also be called on the server:
newClient.sum();
The following example creates two functions that you can call from either a client-side or server-side script:
application.onConnect = function(clientObj) {
// The function foo returns 8.
clientObj.foo = function() {return 8;};
// The function bar is defined outside the onConnect call.
clientObj.bar = application.barFunction;
};
// The bar function adds the two values it is given.
application.barFunction = function(v1,v2) {
return (v1 + v2);
};
You can call either of the two functions that were defined in the previous example (foo and bar) by using the
following code in a client-side script:
c = new NetConnection();
c.call("foo");
c.call("bar", null, 1, 1);
You can call either of the two functions that were defined in the previous example (foo and bar) by using the
following code in a server-side script:
c = new NetConnection();
c.onStatus = function(info) {
if(info.code == "NetConnection.Connect.Success") {
c.call("foo");
c.call("bar", null, 2, 2);
}
};
Client.__resolve()
Client.__resolve = function(propName){}
Provides values for undefined properties. When an undefined property of a Client object is referenced by Server-
Side ActionScript code, the Client object is checked for a _
resolve() method. If the object has a _resolve()
method, it is invoked and passed the name of the undefined property. The return value of the _
resolve() method
is the value of the undefined property. In this way, _
resolve() can supply the values for undefined properties and
make it appear as if they are defined.
Availability
Flash Communication Server 1
Parameters
propName A string indicating the name of an undefined property.
Returns
The value of the property specified by the
propName parameter.
Vedere la pagina 43
1 2 ... 39 40 41 42 43 44 45 46 47 48 49 ... 154 155

Commenti su questo manuale

Nessun commento