Reputation: 3574
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
Upvotes: 0
Views: 701
Reputation: 46027
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);
}
Upvotes: 1