NetConnection.clone( )

NetConnection.clone( ) MethodFlash 6

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


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


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.


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

// is necessary to use clone( )
#include ""
// Set the URL for both connections
// 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

    Part III: Advanced Flash Remoting