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

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 42
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
40
Note: You cannot set this property in the application.onPublish() event.
Example
The following
onConnect() function gives a client read access to myMedia/mp3s, myData/notes, and any files or
directories within them:
application.onConnect = function(newClient, name){
newClient.readAccess = "myMedia/mp3s;myData/notes";
};
Client.referrer
clientObject.referrer
Read-only; A string containing the URL of the SWF file or the server in which this connection originated.
Availability
Flash Communication Server 1
Example
application.onConnect = function(newClient, name){
trace("New user connected to server from" + newClient.referrer);
};
Client.remoteMethod()
myClient.remoteMethod = function([p1, ..., pN]){}
Invoked when a client or another server calls the NetConnection.call() method. A remoteMethod parameter is
passed to
NetConnection.call(). The server searches the Client object instance for a method that matches the
remoteMethod parameter. If the method is found, it is invoked and the return value is sent back to the result object
specified in the call to
NetConnection.call().
Availability
Flash Communication Server 1
Parameters
p1, ..., pN Optional parameters passed to the NetConnection.call() method.
Example
The following example creates a method called
sum() as a property of the Client object newClient on the server
side:
newClient.sum = function(op1, op2){
return op1 + op2;
};
The sum() method can then be called from NetConnection.call() on the client side:
nc = new NetConnection();
nc.connect("rtmp://myServer/myApp");
nc.call("sum", new result(), 20, 50);
function result(){
this.onResult = function (retVal){
output += "sum is " + retVal;
};
this.onStatus = function(errorVal){
Vedere la pagina 42
1 2 ... 38 39 40 41 42 43 44 45 46 47 48 ... 154 155

Commenti su questo manuale

Nessun commento