<services-config>And changed my project properties to add this line to the Flex Compiler page:
<channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
But I just came across this post which shows how to get around having to have an XML file by defining the channel at runtime.
So here is my simplified Flex code:
You could also do the same in MXML:
<mx:RemoteObject source="TestService" destination="amfphp"
And the corresponding PHP code (put the php file inside your webroot/amfphp/services directory):
So what are the benefits of this approach? Well, I'm not sure. In my case it was better because I have one logging class that does all the remoting, and is used by many different Flex applications. So instead of having to duplicate the services-config.xml file in every flex application this way I could define my endpoint url (http://localhost/amfphp/gateway.php) in one place.
Here is another site that is useful when getting started with amfphp: