I found that if I send a string "[0,1,2,3,4]" and then retrieve it and do JSON.parse(Data.objName.Value) it will return it as an array.... is there a better way to send it though? When I try JSON.stringify([0,1,2,3,4]) it stores all the values as objName[0]=0 objName[1]=1, etc.
Player Data is stored as strings in the service. The best way to manage converting back and forth between the data types you want (arrays, in this case) and that string would be via ToString operations or using JSON and using stringify/parse, as you saw in your example. The problem with the array in your example is that you don't have a defined key/value structure in the data you were passing in as your JSON, so the JSON serializer "helped" by adding that. If you were to instead make an array object like:
var nums = [ 0, 1, 2, 3, 4 ];
And then stringify that, you'd get the string I believe you are expecting.
thanks Brendan, that didn't work though (in AS3 anyways). I ended up writing my own functions to convert an Array (including Nested Array) into a String, and back from a String into an Array (possibly a Nested Array). This seems to be the easiest way to store data as a nested array.
2 People are following this question.