0

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

2
  • What is the error that you are getting? How are you parsing? Please show us some code. Otherwise it's difficult to guess the problem. Commented Aug 23, 2011 at 5:51
  • @ taskinoor Hi I have attached code . I am very new to As3 . please guide me to solve this Commented Aug 23, 2011 at 6:11

1 Answer 1

1

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);
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.