`
miss4813
  • 浏览: 102467 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

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"){
		操作。。。
	}
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics