1
I持ってFlash Builderで、次の2つのルーチン:as3corelib JSONの解析問題
public function getData():void {
httpService = new HTTPService();
httpService.url = "https://mongolab.com/api/1/databases/xxx/collections/system.users/?apiKey=xxx";
httpService.resultFormat = HTTPService.RESULT_FORMAT_TEXT;
httpService.addEventListener(ResultEvent.RESULT, resultHandler);
httpService.send();
}
public function resultHandler(event:ResultEvent):void {
var rawData:String = String(event.result);
var arr:Array = JSON.decode(rawData) as Array;
Debug.log(rawData);
Debug.log(arr);
httpService.removeEventListener(ResultEvent.RESULT, resultHandler);
}
RAWDATAは、JSONデータとして表示されますが、ARRは、[オブジェクトのオブジェクト]と表示されているのではなく配列。
私は間違っていますか?
ありがとう。遅れて返信して申し訳ありません。 –
これが正解であれば、plsはそのようにマークします。どうも – pkyeck