How do I load external *.json file in webstorage

Get help using Construct 2

Post » Sun Oct 05, 2014 8:27 am

Hi!
I need load digital data in game to create some object, i create *.jsom file with this objects data.
Now how i can load *.json to webstorage or array?
B
5
Posts: 1
Reputation: 227

Post » Wed Oct 08, 2014 6:12 am

if I'm not mistaken, use the BROWSER object to load a file... that file must be in your FILES folder under your project structure.
Image
B
58
S
13
G
6
Posts: 271
Reputation: 12,128

Post » Wed Oct 08, 2014 6:30 am

Add your json to projects and use ajax
I wrote this tutorial awhile ago, it has the json in projects files, it uses ajax, pretty straight forward really. I know it was to actually use the data in array, but how I got the data into array is what you want to look at.

Edit: just took screenshot
Now you have your array you need to save it to webstorage
set to webstorage.JPG

Ingamedata is the name of my array in this example
You do not have the required permissions to view the files attached to this post.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,728


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests