NetConnection.ReplaceGatewayUrl( ) Method | Flash 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 NetServices.as file.
The following code shows the basic syntax of the ReplaceGatewayUrl( ) method:
#include "NetServices.as" if (connected == null) { // Initialize the variable so this section is only called once connected = true; // Create the NetConnection object gatewayURL = "http://www.flash-remoting.com/flashservices/gateway"; var my_conn = NetServices.createGatewayConnection(gatewayURL); }
Then, at some later time:
newGatewayURL = "http://127.0.0.1/flashservices/gateway"; my_conn.ReplaceGatewayUrl(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.
NetConnection.close( ), NetConnection.connect( ), NetServices.createGatewayConnection( ), NetServices.setDefaultGatewayUrl( ); Chapter 4