我在Adobe Flex mobile上创建一个应用程序(确切地说是Blackberry playbook)。我设计的应用程序具有搜索功能,可以向服务器发出简单的HTTP请求并等待响应......
当用户点击搜索时,如何创建一个“搜索...”的警告框,并且在我们收到HTTP响应之前不会消失?
由于 菲尔
答案 0 :(得分:0)
将事件侦听器添加到侦听响应的HTTP对象
然后显示开始搜索对话框并在调用响应侦听器时隐藏它
private var service:HTTPService
public function useHttpService(parameters:Object):void {
service = new HTTPService();
service.destination = "sampleDestination";
service.method = "POST";
service.addEventListener("result", httpResult);
service.addEventListener("fault", httpFault);
service.send(parameters);
}
public function httpResult(event:ResultEvent):void {
var result:Object = event.result;
//in your case show the dialog on search click and hide the dialog here.
}
public function httpFault(event:FaultEvent):void {
var faultstring:String = event.fault.faultString;
Alert.show(faultstring);
}
]]>
</mx:Script>