NetConnection.ReplaceGatewayUrl( )


NetConnection.ReplaceGatewayUrl( ) Method Flash 6

changes the gateway URL
   myNetConnectionObject   .ReplaceGatewayUrl(   targetURL   ) 

Arguments

targetURL

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

Description

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.

Example

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); 

Usage

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



Flash Remoting
Flash Remoting: The Definitive Guide
ISBN: 059600401X
EAN: 2147483647
Year: 2003
Pages: 239
Authors: Tom Muck

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net