As i'm not sure what api you're using to decode json: Once you convert it to object info you're looking for is accessible as:
when N is length of given array and "json" is top most object from loaded data,
Thank you very much for your help, Peter!
I realize this is a dumb question but maybe the coffee just hasn't kicked in yet. I"m trying to loop through the JSON reponse and came up with the following statement:
for (i = 0; i< manager.routes.legs.steps[i].html_instructions.length; i++)
TxtAreaDirections.text += manager.routes.legs.steps[i].html_instructions.toString() + "\n\n";
I'm getting all the results I need but I'm also getting:
TypeError: Error #1010: A term is undefined and has no properties.
I can't figure out what's wrong with my loop. Any help is much appreciated!
you need to be careful what is used as source for your loops conditions, for example "html_instructions" is String adn I think it was not your intent to use it as array-like accessing counter. It would rather be I think:
var manager:Object = com.brokenfunction.json.decodeJson(data as ByteArray);
var steps:Array = manager.routes.legs.steps;
for(var i:Number = 0; i < steps.length; i++)
var step:Object = steps[i];