1

I got a problem with the Construct 2 Editor of Scirra. I don't really know if this is the right place for this but, I searched for an answer a long time.

I get data of an AJAX Request, which looks like this:

{"data":[ [625],[500] ], [ [400],[500] ], [ [100],[120] ]}

Now, I don't want to get this as a string. I want to split it like

variable a = 625

variable b = 500

And so on.

Zoe
  • 27,060
  • 21
  • 118
  • 148
MCSell
  • 215
  • 6
  • 17

1 Answers1

3

First, use the Array object to generate some data and use the AsJSON expression to retrieve its data. This then shows you the format Construct 2 expects array data to be in. Note the JSON includes additional information like the dimensions of the array, and is always saved in a 3D format, so the example you gave won't work.

Once you've got your JSON in a format Construct 2 understands, just upload it to your server and AJAX request the file. It should load in to the Array object just fine.

AshleysBrain
  • 22,335
  • 15
  • 88
  • 124