How to parse JSON from a service

Discussion and feedback on Construct 2

Post » Sun Nov 25, 2012 6:47 am

Hello. I got a service. when I hit a url, I can download a JSON string, such as:
{"timestamp":1353825777830,"token":"dZEA14OUA4\/L\/P7Yd+WHkGo44O0=","userid":"cxy"}

Let's say I want to show the token in a text box. How can I do that? I tried to use dictionary, but can't figure it out.

Thanks.
B
5
S
1
Posts: 10
Reputation: 472

Post » Fri Jan 11, 2013 7:35 pm

I also wanted to know this... How can it be done?
B
7
S
1
Posts: 7
Reputation: 839

Post » Fri Jan 11, 2013 8:45 pm

Have a look at Rex's plugin here as alternative to the dictionary
I find it easier to handle JSON
B
20
S
5
G
8
Posts: 325
Reputation: 6,473

Post » Fri Jan 11, 2013 10:31 pm

Yeah, native json parsing in construct 2 is very poor. You'll need to use Rex's plugin like lemo mentioned.

I'd love to see a jquery jyntax on an official plugin, so we could feed it a string like "player[1].vehicle.movement.speed" and it would return a value.
B
35
S
8
G
8
Posts: 532
Reputation: 6,868


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests