I try to convert some JSON string data from JSON object into an array.
When I loop over the JSON is it assign the JSON strings into diffrent array cells, eventually I get all the strings from the JSON but in diffrent order in the array each time I run the program.
for (var i:String in data)
{
// get panel tabs and players for each tab
for (var f:String in data[i].tabs)
{
tabsNames.push(f);
}
}
sometimes tabsNames = [ 1,2,3]
sometimes tabsNames = [ 2,3,1] etc’
I cant use sort because I cant know the type of the information that I will get from the JSON.
A JSON object is an unordered set of name/value pairs:
A JSON array is an ordered collection of values:
If your data will be stored in JSON Object as list, you always get data in same order.