ActionScript Message Format (AMF) is a data format that transfers data as binary, which is smaller and faster than other data transfer formats. AMF is a proprietary format created by Macromedia and now owned by Adobe and used in many of their product lines including ColdFusion, which will be demonstrated in this chapter.
Starting with version 7.02, ColdFusion has supported the ability of a CFC (ColdFusion Component) to be called directly from Flex, with data transport occurring over the very speedy AMF format. The following example demonstrates how to connect to a ColdFusion server from AIR via the <mx:RemoteObject> tag using RPC (Remote Procedure Calls). For this example, you will need a ColdFusion server. A free developer version can be downloaded from Adobe.com.
This example includes two ColdFusion components. The first is the main access point in which AIR will communicate, and the second is a value object, which will demonstrate how server-side ColdFusion objects can be mapped to ActionScript objects. Please follow these steps to get the backend ColdFusion files created.
Create a new directory directly under the root of your ColdFusion 7.02 or later server, and name it beginningAIR. Within that folder, create a new directory named business. So far your directory structure should look like Figure 7-1.
Now create a new file within the business directory, and name ...