To specify a CFC to connect to, you do one of the following:

  • Specify the dot-delimited path from the web root to the CFC in the MXML.
  • Create a named resource for the CFC. Creating this resource is like registering a data source; you then use the resource name in your XML.

Specify the CFC in the MXML

To specify the CFC in your MXML, use code such as the following:


ColdFusion 9 supports BlazeDS that allows messaging support for ColdFusion. When you install ColdFusion, the following files are added to the /WEB-INF/flex directory:

  • remoting-config.xml
  • messaging-config.xml
  • services-config.xml
  • proxy-config.xml
    The destination ColdFusion is preconfigured in remoting-config.xml. The default source value for this destination is the wildcard, *. For more information about the changes in Flash Remoting for ColdFusion 9, see Changes in the XML configuration files for Flash Remoting in ColdFusion 9 and ColdFusion 9.0.1.
    You do not have to use the ColdFusion destination if you have configured other valid destinations in the configuration file. In this case, the destination definition must specify * as the value of its source element. If you specify a source other than * in remoting-config.xml, then that source definition overrides the source specified in the MXML.

For details of defining a destination, see Create a named resource for a CFC below.

Create a named resource for a CFC

  1. Edit the WEB-INF/flex/remoting-config.xml file by adding a destination entry for the CFC, for example:

    <service id="remoting-service" class="" messageTypes="flex.messaging.messages.RemotingMessage">
    <adapter-definition id="cf-object"
    class="coldfusion.flash.messaging.ColdFusionAdapter" default="true" />
    <adapter-definition id="java-object"
    class="" />

    <channel ref="my-cfamf" />
    <destination id="ColdFusion">

    <channel ref="my-cfamf" />

    The sourceattribute specifies the dot notation to the CFC from the web root (the classpath to the CFC). The channel-ref tag refers to the channel-definition in the services-config.xml file. In the preceding sample, the my-cfamf channel-definition has been referenced, which looks similar to the following:

    <channel-definition id="my-cfamf" class="mx.messaging.channels.AMFChannel"> <endpoint uri="http://{}:{server.port}{context.root}/flex2gateway/" class="coldfusion.flash.messaging.CFAMFEndPoint" />

  2. Restart the ColdFusion server.
    The following table describes the XML attributes for remoting-config.xml:



destination id

The destination attribute that the MXML mx:RemoteObject tag must specify to access the CFC.


A container for one of more child channel attributes specifying the AMF channels to use to access the ColdFusion server.


Reference to the channel-definition id specified in the services-config.xml file.


The dot-delimited file path to the CFC, from the cfWebRoot, or, if the use-mappings property is true, an entry in the ColdFusion Administrator Mappings page.


Properties that control how the CFC is accessed on the ColdFusion server.

The following table lists the XML attributes for services-config.xml:



channel-definition id

Channel definition


Contains tags to set access levels, mappings to find CFCs, access to public or remote methods.


define the resolution rules and access level of the CFC being invoked


Use the ColdFusion mappings to find CFCs, by default only CFC files under your web root can be found.


Allow "public and remote" or just "remote" methods to be invoked


Whether the Value Object CFC has getters and setters. Set the value of use-accessors to true if there are getters and setters in the Value Object CFC.


Set the value of use-structs to true if you don't require any translation of ActionScript to CFCs. The assembler can still return structures to Flex, even if the value is false. The default value is false.




Whether to make property names, query column names, and structure keys lowercase when converting to ActionScript. Query column names must precisely match the case of the corresponding ActionScript variables. The default value is false.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy