Connect a Database with Macromedia Flash Remoting MX Using Flash ActionScript


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.

Listing E.13 Flash ActionScript for Connecting a Database with Flash Remoting MX
 // 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"); }; 


Macromedia Flash Communication Server MX
Macromedia Flash Communication Server MX
ISBN: 0735713332
EAN: 2147483647
Year: 2002
Pages: 200
Authors: Kevin Towes

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net