Name
NetConnection.clone( ) Method
Synopsis
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 useclone( )
#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
Get Flash Remoting: The Definitive Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.