MACROMEDIA FLASH MEDIA SERVER 2-CLIENT-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR FLASH MEDIA SERVER 2 Manual de usuario Pagina 34

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 172
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 33
31
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
The following example shows how to use the application.registerClass() method with the prototype property:
function A(){}
function B(){}
B.prototype = new A();
// Set constructor back to that of B.
B.prototype.constructor = B;
// Insert code here.
application.registerClass("B", B);
application.registerProxy()
application.registerProxy(methodName, proxyConnection [, proxyMethodName])
Maps a method call to another function. You can use this method to communicate between different application
instances that can be on the same Adobe Media Server or on different Adobe Media Servers. Clients can execute server-
side methods of any application instances to which they are connected. Server-side scripts can use this method to
register methods to be proxied to other application instances on the same server or a different server. You can remove
or unregister the proxy by calling this method and passing
null for the proxyConnection parameter, which results
in the same behavior as never registering the method at all.
Availability
Flash Communication Server 1
Parameters
methodName A string indicating the name of a method. All requests to execute methodName for this application
instance are forwarded to the
proxyConnection object.
proxyConnection A Client or NetConnection object. All requests to execute the remote method specified by
methodName are sent to the Client or NetConnection object specified in the proxyConnection parameter. Any result
returned is sent back to the originator of the call. To unregister or remove the proxy, provide a value of
null for this
parameter.
proxyMethodName A string indicating the name of a method for the server to call on the object specified by the
proxyConnection parameter if proxyMethodName is different from the method specified by the methodName
parameter. This is an optional parameter.
Returns
A value that is sent back to the client that made the call.
Example
In the following example, the application.registerProxy() method is called in a function in the
application.onAppStart() event handler and is executed when the application starts. In the function block, a new
NetConnection object called
myProxy is created and connected. The application.registerProxy() method is
then called to assign the method
getXyz() to the myProxy object.
application.onAppStart = function(){
var myProxy = new NetConnection();
myProxy.connect("rtmp://xyz.com/myApp");
application.registerProxy("getXyz", myProxy);
};
Vista de pagina 33
1 2 ... 29 30 31 32 33 34 35 36 37 38 39 ... 171 172

Comentarios a estos manuales

Sin comentarios