Action Script 3.0 : parsing json data
I want to parse the json data shown in this link in AS3开发者_如何学运维 to obtain the "message" field . I am trying with as3corelib.swc with no success. The json data seems to be bit different . Please help me to parse this
I am using the below code
var j:Object = JSON.decode(Json_data);
var message:String = j["message"];
trace(message);
Here trace always showing null
There is no message
under root object. Probably you are looking for this:
var j:Object = JSON.decode(str);
var data:Array = j["data"];
for (i = 0; i < data.length; i++) {
trace(data[i].message);
}
精彩评论