1

您好我正在尝试使用 flex mx:HTTPService 发送一个简单的 GET 请求:

<mx:HTTPService 
 id="service"
 resultFormat="text"
 result="loadJSONDataToTree(event);" 
 method="GET"
 useProxy="false"
/>

应该发送请求的代码:

service.url = base_url + "workbench/pipeline/";
service.send();

事件处理程序:

private function loadJSONDataToTree(event: ResultEvent): void
{
    // just making sure the method is called
    var f_dp: ArrayCollection = new ArrayCollection();
    f_dp.addItem("2");
    TreeView.dataProvider = f_dp;
}

似乎调用了 send() 方法,但从未触发事件并且未发送请求,因为我在服务器日志中看不到任何请求。这种行为的原因可能是什么?

4

1 回答 1

2

你应该fault在你的HTTPService. 如果出现任何类型的故障,您的fault事件处理程序应该被调用:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/rpc/http/HTTPService.html#event:fault

于 2010-11-16T15:57:38.083 回答