0

データに基づいて RSS フィード アプリケーションを作成しています。次のものがあります。

データが事前に入力された ArrayCollection があります。ArrayCollection を並べ替えて、1 つのデータ (条件) を取得し、タイトルを返す RSS フィードに接続する必要があります。条件 -> タイトルに対応するように 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 を更新します。

これはうまくいきません!ヘルプ!

4

1 に答える 1

0

最初に httpservice で結果イベントを作成し、自分だけがリクエストの結果にアクセスできるようにします。

そのメソッドでは、このlastResult.article.titleのように直接実行できるxmlとして応答を返す場合、必要な値を取り出すresultEventを取得します

<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

于 2009-07-14T10:39:37.977 に答える