如何调用从ActionScript RemoteObject的方法? [英] How do I call a RemoteObject method from ActionScript?

查看:298
本文介绍了如何调用从ActionScript RemoteObject的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是动作相当于这个MXML的?

What's the ActionScript equivalent of this MXML?

<mx:RemoteObject id="Server" destination="Server" source="gb.informaticasystems.Server" fault="handler_backendCommunicationFails(event)" >
  <mx:method name="executeQuery" result="handler_fetchDataRequestSuccess(event)"/>
</mx:RemoteObject>

TIA!

推荐答案

您只需要调用:

Server.executeQuery(...);

它执行

后,处理结果的处理程序,它指定为:

After it executes, you handle the result in your handler, which you specified as:

private function handler_fetchDataRequestSuccess(event:ResultEvent);

编辑:让我翻译的MXML:

Let me translate the MXML:

var Server:RemoteObject = new RemoteObject();
Server.destination = "Server";
Server.source = "gb.informaticasystems.Server";
Server.executeQuery.addEventListener("result", handler_fetchDataRequestSuccess);
Server.executeQuery.addEventListener("fault", handler_backendCommunicationFails);

这篇关于如何调用从ActionScript RemoteObject的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆