flex 多个Remote方法使用一个结果处理函数

<mx:RemoteObject id="tarBiz" destination="targetBiz" showBusyCursor="true">
		<mx:method name="checkName" result="checkHandle(event)" fault="faultHandle(event)"/>
		<mx:method name="addTarget" result="checkHandle(event)" fault="faultHandle(event)"/>
</mx:RemoteObject>	

import mx.rpc.remoting.mxml.Operation;
private var op:Operation=null;

private function a():void{
tarBiz.checkName();
op=tarBiz.getOperation("checkName") as Operation;
op.arguments="a";
}

private function b():void{
tarBiz.addTarget();
op=tarBiz.getOperation("checkName") as Operation;
op.arguments="b";
}


private function checkHandle(evt:ResultEvent):void{
	var opn:Operation=tarBiz.getOperation("checkName") as Operation;
	if(opn.arguments=="a"){
		操作。。。
	}
	if(opn.arguments=="b"){
		操作。。。
	}
}

你可能感兴趣的:(Flex)