// ActionScript file
package com.xt.hb.utils
{
	import mx.rpc.AbstractOperation;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.remoting.RemoteObject;

	public class RemoteUtils
	{
		public function RemoteUtils()
		{
		} 
		public static function callRemote(destination:String,method:String,listener:Function,... args):void
		{
			var ro:RemoteObject=new RemoteObject();
			ro.destination=destination;
			ro.concurrency="multiple";
			var oper:AbstractOperation= ro.getOperation(method);
			ro.addEventListener(ResultEvent.RESULT,listener);
			ro.addEventListener(FaultEvent.FAULT, listener);
			oper.arguments = args;
			oper.send();
		}
	}
}