Someone helped me a while back figure this out (sorry, I can't remember who, if it was you, let me know!) but I thought it was quite useful, because it gives you a lot more flexibility.
This allows you to create your remote objects for flex to talk to CF in actionscript instead of using the mx:RemoteObject tags.
Here is the example code:
import mx.rpc.remoting.RemoteObject;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.InvokeEvent;
import mx.messaging.Channel;
import mx.messaging.channels.AMFChannel;
import mx.messaging.ChannelSet;
import flash.events.Event;
import mx.controls.Alert;
public function onCreationComplete () : void
{
//create the remote objects first
createRemoteObjects();
//set the AMF Channel on the remote objects
setUpAmfChannel();
}
public function createRemoteObjects () : void
{
ro = new RemoteObject();
ro.destination = "ColdFusion";
ro.source = "path.to.cfc";
ro.addEventListener("fault",ro_fault_handler);
//You probably want and need a result handler...
ro.methodName.addEventListener("result",methodName_result_handler);
//You may need this if you need to do something when a method is called
ro.methodName.addEventListener("invoke",methodName_invoke_handler);
//You may need this if you need to catch and handle errors differently
ro.methodName.addEventListener("fault",methodName_fault_handler);
//This is just sugar, you really dont need it unless you want it.
ro.methodName.showBusyCursor = true;
}
/* You can call the following method anytime to set the amf channel for a remote object on the fly */
public function setUpAmfChannel () : void
{
var amfChannel:Channel = new AMFChannel("my-cfamf","http://server/flex2gateway/");
amfChannelSet = new ChannelSet();
amfChannelSet.addChannel(amfChannel);
//repeat the following line for all remoteObjects
this.ro.channelSet = amfChannelSet;
}
public function ro_fault_handler ( event:FaultEvent ) : void
{
Alert.show( event.fault.faultString, 'Error');
}
public function call_methodName () : void
{
//use this to call the method
ro.methodName(/*pass arguments here*/);
}
public function methodName_invoke_handler ( event:InvokeEvent ) : void
{
//this will fire when the method is invoked
}
public function methodName_fault_handler ( event:FaultEvent ) : void
{
//this will fire when the method throws an error
}
public function methodName_result_handler ( event:ResultEvent ) : void
{
//this will fire when a result comes back from the method
}
You can see how the remote object is created, the methods are defined along with the actionscript methods that handle faults, invokes and results, and you can also specify the amf-channel on the fly, which is quite nice. This gives you far more flexibility when calling your remote object methods than the mxml does in my opinion.

1
Mike Nimer posted how to do this just last week: http://www.mikenimer.com/index.cfm/2007/1/10/Bye-bye-services
2
oh my gosh, this solves a big problem I've been having. Keep up the good work! btw, kudos to Mike Nimer as well, that debugger he came up with has saved my bacon, too.