1.  
  2. In the MXML file, you use the <mx:RemoteObject> tag to connect to your CFC named resource. With this connection, you can call any remote method on the CFC.
  3. If you created a destination for the CFC in the remoting-config.xml file, specify the destination name in the mx:RemoteObjecttag; for example:

    id="a_named_reference_to_use_in_mxml"
    destination="CustomID"
    result="my_CFC_handler(event)"/>

    If you did not create a destination for the CFC, specify the ColdFusion destination and the CFC path in the mx:RemoteObbjecttag; for example:

    id="myCfc"
    destination="ColdFusion"
    source="myApplication.components.User"/>

  4. Call a CFC method, for example, as the following example shows:

    <mx:Button label="reload" click="my_CFC.getUsers()"/>

    In this example, when a user presses a button, the Click event calls the CFC method getUsers.

  5. Specify a handler for the returned result of the CFC method call for the <mx:RemoteObject>tag, as the following example shows.

    {
    // Show alert with the value that is returned from the CFC.
    mx.controls.Alert.show(ObjectUtil.toString(event.result));
    }

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