我正在基于数据创建一个RSS Feed应用程序,并且我有以下内容:
我有一个预先填充了数据的ArrayCollection。我正在对ArrayCollection进行排序,获取1条数据(条件),需要连接到一个返回标题的RSS feed,并将我的ArrayCollection设置为与条件->标题相对应。
public function updateArrayList(list:ArrayCollection):ArrayCollection {
trace(list);
for(var i:int = 0; i < list.length; i++) {
// Alert.show(list.getItemAt(i).condition);
getRSSUpdate(list.getItemAt(i).condition);
list.getItemAt(i).title = getRSS.lastResult.article.title;
}
return list;
}
public function getRSSUpdate(condition:String):void {
getRSS = new HTTPService();
getRSSParam = new Object;
getRSSParam.condition = condition;
getRSS.method = "POST";
getRSS.url = "http://localhost/site/remoteRequests/flash/rss/getRSS.php";
getRSS.send(getRSSParam);
}基本上,我希望遍历列表ArrayCollection,并使用从HTTPService传递的结果更新list.getItemAt(i).title。
这不管用!帮助!
发布于 2009-07-14 10:39:38
首先在httpservice上创建一个结果事件,因为只有您才能访问请求的结果。
在该方法中,您将从所需值中获取resultEvent,如果它以xml形式返回响应,则可以直接像下面这样做
<mx:HTTPService id="yahooHTTPService"
url="http://search.yahooapis.com/WebSearchService/V1/webSearch"
method="GET"
makeObjectsBindable="true" result="httpServiceResult(event)"
fault="httpServiceFault(event)" showBusyCursor="true">
</mx:HTTPService>下面是一个http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_2.html#193905示例
https://stackoverflow.com/questions/1123630
复制相似问题