
51
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
You can also call the sum() method in server-side code:
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.reportedAddresses
clientObject.reportedAddresses
Read-only; an Array of Strings containing all the addresses at which a client can receive RTMFP traffic. The client can
update this value multiple times over the lifetime of its RTMFP connection to the server.
There is a small time lag between when the client is connected and when it reports its IP addresses. The time lag is
usually a few hundred milliseconds. When the server receives the reported addresses from the client, it gets an
Client.onReportedAddressChange() event. The reported addresses are valid only after the first
onReportedAddressChange() event.
Use this property to distribute peer introductions across multiple servers. See Distribute peer introductions across
multiple servers.
Availability
Flash Media Server 4.5
Example
The following function outputs a list of all the reported addresses for a client:
Kommentare zu diesen Handbüchern