The Flash ActionScript in Listing E.13 connects the Flash player directly to a Flash Remoting MX service. A Service method is called and handled similar to the SSAS operation. Remember, Flash Remoting MX is nonpersistent. A connection is established each time a service method is invoked.
// Include the Required Flash Remoting NetService class files #include "NetServices.as" #include "NetDebug.as" // Define the connection to the Flash Remoting Server NetServices.setDefaultGatewayUrl("http://localhost/flashservices/gateway"); gatewayConnnection = NetServices.createGatewayConnection(); // Define the service to a local variable, cf_service cf_Service = gatewayConnnection.getService("myFlashComService.login_service", this); trace("REMOTING INITIALIZED"); // Call a Remoting Service Function cf_service.authenticateUser("Kevin", "TIN"); // Handle the Service method, "authenticateUser" when returned from the server authenticateUser_Result = function (result_rs) { trace("The Server Responded ?> "+result_rs.getLength()); trace("The firstName value of row 0 ?> "+result_rs.items[0].firstName); }; // handle any server errors authenticateUser_Status = function (status) { trace("Returned FAILED From the Server"); };