如果可能的话,我想重用一个s:HTTPService
组件。我无法理解如何将参数传递给服务调用,以便可以更改结果函数。
例如,
functOne(), HTTPService result = "FunctOneRtn(event)"
functTwo(), HTTPService result = "FunctTwoRtn(event)"
弹性 4.6
<fx:Declarations>
<s:HTTPService id="myCall" url="http://myUrl.com/"
useProxy="false" method="POST" result=funct***Rtn(event) >
</s:HTTPService>
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
private function functOne() :void
{
var params:Object = new Object();
/* call FuntOneRtn */
myCall.send(params);
}
private function functTwo() :void
{
var params:Object = new Object();
/* call FuntTwoRtn */
myCall.send(params);
}
public function FunctOneRtn(event:ResultEvent) : void{
// Do Some Stuff
}
public function FunctTwoRtn(event:ResultEvent) : void{
// Do Some Stuff
}
]]>
</fx:Script>
谢谢艺术