JSON Array

Get help using Construct 2

Post » Mon Mar 25, 2013 9:32 pm

Hello folks, can anyone tell me how I should set out my array in the JSON file please? So far I have, for example:

{
    "language": ["word1", "word2", "word3", "word4", "word5", "word6"]
}

I know the data is being retrieved from the JSON file using AJAX.LastData. However, i'm unsure how to acquire certain words from this array, and populate an entire array in construct. At the moment I have:

On "wordsjson" completed:
   HashTable -> Load hash table from JSON string AJAX.LastData
   Array -> Load from JSON string HashWords.At("language")

Thanks a lot, Rogalog.
B
12
S
1
Posts: 29
Reputation: 908

Post » Tue Mar 26, 2013 6:29 pm

I have started trying to answer a question similar to this here:
http://www.scirra.com/forum/topic64791_post401818.html#401818

I will have a capx with this soon...
B
6
S
3
G
1
Posts: 102
Reputation: 1,379

Post » Tue Mar 26, 2013 8:10 pm

Here is a capx using the Dictionary and JSON system:
https://docs.google.com/file/d/0B4hvjRyB7pvBZEUtdUhvX3ZLVkU/edit?usp=sharing

also here is a cool JSON syntax validator:
http://jsonlint.com/
B
6
S
3
G
1
Posts: 102
Reputation: 1,379


Return to How do I....?

Who is online

Users browsing this forum: Braus and 16 guests