NetConnection.ReplaceGatewayUrl( )

NetConnection.ReplaceGatewayUrl( ) MethodFlash 6

changes the gateway URL



A URL of the Flash Remoting gateway that you wish to connect to. The URL must be prepended with an http:// or https:// protocol.


The ReplaceGatewayUrl( ) method is used to change the Flash Remoting gateway URL previously specified via NetConnection.connect( ), NetServices.createGatewayConnection( ), or NetServices.setDefaultGatewayUrl( ). Using the ReplaceGate-wayUrl( ) method requires the inclusion of the file.


The following code shows the basic syntax of the ReplaceGatewayUrl( ) method:

#include ""
if (connected == null) {
  // Initialize the variable so this section is only called once
  connected = true;
  // Create the NetConnection object
  gatewayURL = "";
  var my_conn = NetServices.createGatewayConnection(gatewayURL);

Then, at some later time:

newGatewayURL = "";


You should not use this method directly, because it is reserved for use by the server, which can pass a ReplaceGatewayUrl header to the Flash movie.

See Also

NetConnection.close( ), NetConnection.connect( ), NetServices.createGatewayConnection( ), NetServices.setDefaultGatewayUrl( ); Chapter 4

    Part III: Advanced Flash Remoting