Hello,
I am getting different result while using Reflect on a JSON string. My JSON string is really simple (has a couple fields such as Firstname, Lastname, Username etc.) and I'm trying to iterate through them.
The following code piece works in Flash target, but not in Neko or Windows targets. Not exactly sure why.
//data is the JSON result I get from my webservice
var parsedData = Json.parse(data);
for (key in Reflect.fields(parsedData)) {
var myObj = Reflect.field(parsedData, key);
trace(myObj);
}
When I target Flash, I can see the trace output for all the objects (approximately 10 objects returned from JSON). When targeting Neko though, instead of seeing multiple lines for the trace output, I only see 1 line, which looks like the complete resultset (not individual objects as in Flash). It looks like it is not iterating over the parsed JSON resultset when targeting Neko.
Is there any other (hopefully cross platform) way to parse JSON output and iterate over the data?
Thanks.