1

私はこのボタンを持っています:

<s:Button includeIn="MeniuPrincipal" label="Descarcare Date" click="downloadLmData(event)"/>

そして、このクリックイベントハンドラー:

protected function downloadLmData(event:MouseEvent):void
{
    downloadData('competenta', 'competente');
    downloadData('localitate', 'localitati');
}

downloadData 関数は次のようになります。

private function downloadData(item:String, items:String):void 
{
    try {
        var colVar:String   = 'col' + cappitalize(items);

        this.status = "Descarcare date in curs...";

        this[colVar] = null;

        var service:HTTPService = new HTTPService();
        service.url = serverUrl + items + '/xml';
        service.resultFormat = "xml";
        service.method = "GET";
        service.addEventListener(ResultEvent.RESULT, addArguments(downloadDataComplete, [item, items]));
        service.send();
    } catch (error:Error) {
        errorHandler.defaultErrorHandler(error);
    }
}

問題は、最初の呼び出しを除いて、すべての呼び出しが無視されることです。すべての呼び出しを可能にする「キューイング」メカニズムはありますか?

ありがとうございました。

4

2 に答える 2

1

非同期呼び出しをチェーンする必要があります。実装については、次の 2 つのブログ投稿を参照してください。

http://kuwamoto.org/2006/05/16/dealing-with-asynchronous-events-part-1/

http://kuwamoto.org/2006/05/16/dealing-with-asynchronous-events-part-2/

于 2011-03-15T17:58:36.693 に答える