You can read more about Flex 3 and Remote Object Call on my blog here:
Flex 3 Pass Arguments from Flex 3 to ColdFusion CFC
As with everything in Flex, you can create an object in 2 ways, MXML and ActionScript. Creating the remote object in ActionScript is almost the same as when you create it in MXML. To me, its nice to create it in ActionScript within an init() function on creationComplete(), but either way works the same.
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="top"
xmlns:components="*"
xmlns:local="*"
applicationComplete="init()">
import mx.rpc.remoting.RemoteObject;
private var ro:RemoteObject;
private function init():void
{
ro = new RemoteObject("ColdFusion");
ro.source = "cfctest.thecfc";
}
Here is the equivalant MXML version with a few more methods inserted. Also, I am creating the result and fault functions:
<mx:RemoteObject id="mycfc"
destination="ColdFusion"
showBusyCursor="true"
source="cfctest.thecfc"
result="result(event)"
fault="fault(event)">
<mx:method name="sendargument" result="myfoo(event)"/>
<mx:method name="recordcount" result="numberofrecords(event)"/>
<mx:method name="insertrecord" result="confirminsert(event)"/>
</mx:RemoteObject>