suggestion on parsing this JSON access its values?

Get help using Construct 2

Post » Thu Dec 05, 2013 1:09 pm


would like to know some method to read in this JSON from URL and then access each its key/value. looking for tutorial or sample code. thanks!


[{"id":"42","pct":"69th","phone":"17182576211","fax":"","email":"","address":"9720 Foster Avenue","lat":"40.6484","lng":"-73.9049","borough":"queens","city":"nyc","state":"ny","distance":"0.5231590272587"},{"id":"38","precinct":"63rd Pct","phone":"17182584412","fax":"","email":"","address":"1844 Brooklyn Avenue","lat":"40.6281","lng":"-73.9414","borough":"queens","city":"jersey city","state":"ny","distance":"1.854571460077"}]
B
5
S
1
Posts: 78
Reputation: 556

Post » Thu Dec 05, 2013 2:33 pm

http://www.scirra.com/forum/plugin-hash-table_topic47637.html
maybe this works
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Thu Dec 05, 2013 2:40 pm

i really appreciate it. is this a certain solution?
the JSON is flat, so looking to just accessing key/value. thanks.

or anyone else have a straight answer on this QUES. thanks again.
B
5
S
1
Posts: 78
Reputation: 556

Post » Thu Dec 05, 2013 2:45 pm

@mindfaQ, is your suggestion of a solution a two-step or like a two-plugin solution?

No clear answer and description. so please clarify.
B
5
S
1
Posts: 78
Reputation: 556

Post » Thu Dec 05, 2013 2:47 pm

@mindfaQ, i installed rex_csv.7z

i IDE programmed it to load AJAX.LastData containing the JSON above.

So its like CSV.At(key, 0) like that to get value? or is there another step or plugin to drive more people crazy?


broprog2013-12-05 14:49:19
B
5
S
1
Posts: 78
Reputation: 556

Post » Thu Dec 05, 2013 3:28 pm

JSON parsing is a wild goose chase w. no straight answers in C2 haha!
B
5
S
1
Posts: 78
Reputation: 556

Post » Thu Dec 05, 2013 3:40 pm

Have you spent any time at all reading the manual or looking at the example and tutorials?

Or is it that you just expect everyone else to do everything for you, and if you don't receive a satisfactory answer after half an hour, start slagging everyone and everything?

Wow.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
137
S
31
G
87
Posts: 5,556
Reputation: 60,456

Post » Thu Dec 05, 2013 4:14 pm

read a lot of stuff and get no straight anwsers and stuff like yours haha
B
5
S
1
Posts: 78
Reputation: 556

Post » Thu Dec 05, 2013 5:04 pm

Not sure why you install rex_csv when I linked rex_hash. Also I did not work with it yet, so the only thing I know is that it seems to be able to parse json files that are not specially formated for c2.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Thu Dec 05, 2013 5:53 pm

exactly my point before.
B
5
S
1
Posts: 78
Reputation: 556

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 30 guests