【问题标题】:Alert Boxes Adobe Flex mobile - Searching - Block until get response警报框 Adob​​e Flex 移动 - 搜索 - 阻止直到得到响应
【发布时间】:2011-03-29 10:03:12
【问题描述】:

我正在 Adob​​e Flex 移动设备上创建一个应用程序(确切地说是黑莓剧本)。我正在设计一个具有搜索功能的应用程序,该功能向服务器发出简单的 HTTP 请求并等待响应......

当用户点击搜索时,如何创建一个显示“正在搜索...”并且在我们收到 HTTP 响应之前不会消失的警告框?

谢谢 菲尔

【问题讨论】:

    标签: apache-flex adobe


    【解决方案1】:

    将事件监听器添加到监听响应的 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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-04
      • 1970-01-01
      • 1970-01-01
      • 2021-03-16
      • 1970-01-01
      • 2012-01-03
      • 2013-07-25
      • 1970-01-01
      相关资源
      最近更新 更多