Remoting in ActionScript 3 is easy to implement, but there are some important things to keep in mind. Most notably, the mx.remoting package is no longer required. There are no additional packages to install, everything you need is built right in to flash.net

This RemotingConnection class extends NetConnection and sets the objectEncoding to AMF:

package
{
import flash.net.NetConnection;
import flash.net.ObjectEncoding;
public class RemotingConnection extends NetConnection
{
public function RemotingConnection( sURL:String )
{
objectEncoding = ObjectEncoding.AMF0;
if (sURL) connect( sURL );
}
}
}

This class employs the above class, and makes a remote service call:


package
{
import flash.net.Responder;
public class AS3RemotingTest
{
public var dataProvider:Array;
public var gateway : RemotingConnection;
public function AS3RemotingTest()
{
this.init();
}
public function init()
{
var gatewayUrl:String = "http://localhost:88/amfphp/gateway.php";
gateway = new RemotingConnection(gatewayUrl);
var responder:Responder = new Responder(onResult, onFault);
var arg:String = 'foo';
gateway.call( "HelloWorld.say", responder, arg);
}
public function onResult( result ) : void
{
trace('onResult invoked');
trace(result);
}
public function onFault( fault : String ) : void
{
trace('onFault invoked');
trace( fault );
}
}
}

(Note: The above code assumes that you have AMFPHP installed and running out of a folder named amfphp on your localhost)