I was struggling with the same issue and here's what emerged from my struggle ;)
public static function getRemoteObject(destination:String, channelName:String,
showBusyCursor:Boolean=true):RemoteObject{
var remoteService:RemoteObject=new RemoteObject(destination);
var channelSet:ChannelSet=new ChannelSet();
var amf:AMFChannel=new AMFChannel(channelName,
"http://{server.name}:{server.port}" +
(Application.application as Application).parameters.contextRoot +
"/graniteamf/amf");
channelSet.addChannel(amf);
remoteService.channelSet=channelSet;
remoteService.showBusyCursor=showBusyCursor;
return remoteService;
}
So as you can see, I basically do just the things you said you've tried, with my endpoint being partially provided in flashVars at application startup.