MACROMEDIA FLASH MEDIA SERVER 2-CLIENT-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR FLASH MEDIA SERVER 2 Bedienungsanleitung Seite 53

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 172
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 52
50
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
Client.referrer
clientObject.referrer
Read-only; A string containing the URL of the SWF file or the server in which this connection originated. The property
is set when a SWF hosted on a web server or connects to an application on Adobe Media Server. The property is also
set when one Adobe Media Server instance connects to another.
This property is not set when a SWF from a local file system running in stand-alone Flash Player version 10 or above
connects to Adobe Media Server. If a SWF file is running in standalone Flash Player version 8 or 9, the property is set
as
file:///....
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]){}
You can define methods on the Client object and call the methods from client-side code. To call methods from client-
side code, call the
NetConnection.call() method and pass it the name of the method you defined. The server
searches the Client object instance for the method. 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:
Client.prototype.sum = function(op1, op2){
return op1 + op2;
};
You can call the server-side sum() method from a client-side call to the NetConnection.call() method:
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){
output += errorVal.code + " error occurred";
};
}
Seitenansicht 52
1 2 ... 48 49 50 51 52 53 54 55 56 57 58 ... 171 172

Kommentare zu diesen Handbüchern

Keine Kommentare