XMLRPC for Actionscript 3.0 – Free Library
http://danielmclaren.net/2007/08/03/xmlrpc-for-actionscript-30-free-library
Download XMLRPC for AS3
And without further ado, here are the source files:
Some notes:
- The license is LGPL
- The readme, changelog, tests, and examples are out of date.
- Here’s a link to the XML-RPC for AS2 project on SourceForge
- Gregory Goldberg also ported this project to AS3 but removed the fault handling in the process
Sample:
import flash.events.Event;
import flash.events.ErrorEvent;
import com.mattism.http.xmlrpc.*;
import com.mattism.http.xmlrpc.util.*;
function rpcCompleteHandler(evt:Event):void
{
var response:Object = rpc.getResponse();
}
function rpcErrorHandler(evt:ErrorEvent):void
{
var fault:MethodFault = rpc.getFault();
}
var rpc:Connection = new ConnectionImpl('http://localhost/xmlrpc.php');
rpc.addEventListener(Event.COMPLETE, rpcCompleteHandler);
rpc.addEventListener(ErrorEvent.ERROR, rpcErrorHandler);
rpc.addParam(4, XMLRPCDataTypes.INT);
rpc.call('mypackage.myfunction');