webdu 2009 developer conference

Flash Remoting Checklist

Author: Andrew Muller

Flash Remoting allows for the direct communication between an application server and the Flash player, allowing for the easy construction and deployment of Rich Internet Applications.

It is incorporated into both ColdFusion MX and JRun 4 and is available for purchase for both Microsoft .Net and J2EE servers.

Before you commence developing and deploying an application built using Flash Remoting there are a few items you should add to your development checklist to ensure that you have success.

1. Check that the server configuration is correct.

Although incorporated into ColdFusion MX Flash Remoting is configured by default to operate on the localhost web site on Microsoft's IIS from a standard install.

Further adjustment of the server configuration is needed to deploy a Flash Remoting site so that the gateway connection is available to any other domains currently hosted.

There is a TechNote available at Macromedia that covers this issue:

http://www.macromedia.com/support/flash_remoting/ts/documents/iis_gateway_connection.htm

2. Download the Flash Remoting Components.

The Flash Remoting Components give Flash MX the capabilities to develop for Flash Remoting; they do not extend ColdFusion MX any further as it already has the necessary files installed for Flash Remoting.

The components are available for free from the link below and need to be downloaded and installed before developing with the Flash MX authoring environment.

http://www.macromedia.com/software/flashremoting/downloads/components

They include the necessary ActionScript APIs for Flash Remoting and the NetConnection Debugger, an invaluable Flash MX development tool.

3. Set the correct address for the gateway connection.

The Flash movie needs to establish a gateway connection to the application server for Flash Remoting, the address that you use for in your ActionScript is all important because if it differs in any way to the address of the sever it's deployed on the gateway connection will fail.

For example the following address: http://127.0.0.1:8500/flashservices/gateway, is regarded by the server as being a different address to : http://localhost:8500/flashservices/gateway even though both address might logically point to the same server.

4. Save files into the right directory structure.

Flash Remoting requires that all files that it connects to via the gateway connection reside under the web root of the server, they must be either physically located there or virtually there via a server mapping.

5. Use the NetConnection Debugger.

The NetConnection Debugger is such a valuable tool to the developer that it's tempting to also add it to this list as items six, seven, eight, nine and ten.

Installed into Flash MX as part of the Flash Remoting Components, the NetConnection Debugger allows the developer to see the two-way communication between the Flash movie and the application server.

The movies calls to various methods of ColdFusion Components, the SQL debug information returned by the database, and the data transferred to the Flash movie can all be viewed.

Including an ActionScript file, NetDebug.as, enables this communication.

When open in Flash MX the NetConnection Debug can even view the communication of movies deployed on a server as they are used in a browser.

Once the movie's development is finalised and the .swf is ready for it's last compile the include code for the NetDebug.as file should be removed or commented from the Flash document.