XMLRPC for Actionscript 3.0 - Free Library
I just finished porting Matt Shaw's XML-RPC for Actionscript 2.0 code to AS3. This is a really easy way to get Flash to transfer data with an XML-RPC endpoint. Matt did a great job and the conversion wasn't too difficult.
Here's some sample code to show you how to use it.
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');
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
If you have any questions or problems leave a comment here. Enjoy!
Tags


