actionscript 3 and JSON actionscript 3 and JSON json json

actionscript 3 and JSON


You were correct when you had the jsonData variable as an Object. To iterate through all the properties of that variable you could just do something like this:

var jsonData:Object = JSON.decode(loader.data);for (var i:String in jsonData){    trace(i + ": " + jsonData[i]);}

If you wanted to check if the object contained a specific property you could use something like:

var hasFooProperty:Boolean = jsonData.hasOwnProperty("fooProperty");