2

我在 API 请求后获取 JSON 数据。如何访问每个条目的值,例如“name”和“id”?

{"data":[{"category":"Website","name":"Example","access_token":"1234","id":"1234,"perms":["ADMINISTER","EDIT_PROFILE","CREATE_CONTENT","MODERATE_CONTENT","CREATE_ADS","BASIC_ADMIN"]}],"paging":{"next":"https:\/\/graph.facebook.com\/1234\/accounts?
access_token=1234&limit=5000&offset=5000&__after_id=1234"}}

(我使用的是 Flash Player 11)谢谢。乌里

4

1 回答 1

3
var jsonObject:Object = JSON.parse(jsonString);

这将返回一个包含您的数据的对象,因此如果您想访问名称,它将类似于:

for each(var data:Object in jsonObject.data)
{
    trace(data.name);
}
于 2013-06-03T17:42:03.203 回答