Can not get values of Array which load from JSON

Bugs will be moved here once resolved.

Post » Tue Jul 15, 2014 1:41 pm

Problem Description
I use double loops and Array.at() to read data for condition , but I can't get values of Array which its data load from .json file.

This problem occurs in my project , so I created a new project to test , and then there is the same problem in the new project , I think it was not my mistake .

Attach a Capx
https://drive.google.com/file/d/0B06nox ... sp=sharing

Description of Capx
In the test.Capx , there are two Arrays,two ProgressBars,an AJAX object and array.json file.

data of Array1 load from array.json which is requested by AJAX , data of Array2 are generated by random() fuction . Then Using double loops to get values of both Arrays ,and let two ProgressBars adding the values to current progress value .

Steps to Reproduce Bug
  • Use AJAX to request .json file in project .
  • Create Array then load json string fom AJAX.lastdata .
  • use loops to get value of Array , then try any method (eg. condition) to reference Array .

Observed Result
There is weird that I can see values from Array1 in Inspector(load from array.json correctly) , but ProgressBar Can not get the values .

Expected Result
ProgressBar Can get the values of Array1,then adding the values to current progress value,showing performance correctly.

Affected Browsers
  • Chrome: YES
  • FireFox: YES
  • Internet Explorer: YES

Operating System and Service Pack
Windows 7 64bit Service Pack 1

Construct 2 Version ID
Release 173
B
4
Posts: 2
Reputation: 229

Post » Tue Jul 15, 2014 10:30 pm

You have the array format wrong. Download your array2 as json and compare.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Wed Jul 16, 2014 8:39 am

ramones wrote:You have the array format wrong. Download your array2 as json and compare.


Oh,I know what wrong with it. In inspector,I can't perceive what different with it ,so I don't realize that the format is wrong.

thanks reply. ;)
B
4
Posts: 2
Reputation: 229

Post » Wed Jul 16, 2014 2:38 pm

Closing as not a bug.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772

Post » Sun Oct 11, 2015 1:21 pm

What's the solution please?
How do I access JSON data from array, and display in a Text object for instance
B
4
Posts: 5
Reputation: 208

Post » Sun Oct 11, 2015 2:15 pm

@degee147

This is the 'Closed Bug' section and you should not be posting questions here.

If you need help, please post your question in the 'How Do I' section, giving as much detail as you can. Including a .capx will generally help with a much quicker response.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
84
Posts: 5,387
Reputation: 58,456


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest