Log in a user using Flash Remoting

If you are developing a Rich Internet Application with Flash and Flash Remoting, your ColdFusion application does not need to be coded specially for a Flash login. The Flash Remoting gateway makes the user ID and password available to the cflogin tag in the cflogin structure.

In your Flash code, you use the ActionScript SetCredentials method to send login information to ColdFusion. Your Flash SWF file displays the user ID and password fields, and uses their contents in the setCredentials method, as follows:

if (inited == null) 
{ 
    inited = true; 
    NetServices.setDefaultGatewayUrl("http://localhost/flashservices/gateway"); 
    gatewayConnection = NetServices.createGatewayConnection(); 
    gatewayConnection.setCredentials(userID, password); 
    myService = gatewayConnection.getService("securityTest.thecfc", this); 
}

For more information on using Flash Remoting, see Using the Flash Remoting Service and Using Flash Remoting Update.