XMLRPC for Actionscript 3.0 – Free Library

Posted by wpm on Mar 7, 2009 in Framework |

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:


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');

Tags: , , ,