NetConnection.clone( )


NetConnection.clone( ) Method Flash 6

duplicates a connection object, without current headers
   myNetConnectionObject   .clone( ) 

Returns

A new NetConnection object with the same URL as the original NetConnection object, but without the headers of that object.

Description

The clone( ) method is used when you need a new connection to the remote server that does not contain the headers of your existing connection, such as to call a method using a new authentication scheme.

Example

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

 //   NetServices.as   is necessary to use   clone( )   #include "NetServices.as" // Set the URL for both connections NetServices.setDefaultGatewayUrl("http://127.0.0.1/flashservices/gateway"); // Create the original connection var my_conn = NetServices.createGatewayConnection( ); // Set the credentials header for the first connection my_conn.setCredentials('admin', '1234'); // Create the cloned connection without the headers (no credentials) var my_cloneConnection = my_conn.clone( ); 

See Also

NetServices.createGatewayConnection( ) , NetServices.setCredentials( ) ; 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