[r208] Array loaded with JSON string can error.

Bugs will be moved here once resolved.

Post » Thu Jun 25, 2015 4:04 am

Randomly get Javascript error with array loaded with JSON
Click the "Random" button and click through the alerts. Usually after the first few the error will occur.

https://drive.google.com/file/d/0B_14V9 ... sp=sharing

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

Description of Capx
Function (Set Array) that loads an Array with JSON string.
Function (Get Random Number) loop through the array randomly selecting values and removing them from the array so it gets smaller. Each time a value gets selected the array gets smaller so there are no repeated values.



Steps to Reproduce Bug
    Click the "Random" button and click through the alerts. Usually after the first few the error will occur.

Observed Result
An error occurs.
Expected Result
Not to have an error.

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

Operating System and Service Pack
Windows 10 Preview 10130

Construct 2 Version ID
R208

edit: Updated title
B
12
S
2
Posts: 22
Reputation: 648

Post » Sun Jun 28, 2015 6:44 am

Your JSON array is malformed. You have an empty value.
B
9
S
2
Posts: 19
Reputation: 660

Post » Sun Jun 28, 2015 6:00 pm

@juani

Ah, I used a tool to create the JSON and must have missed a cell. Nice catch. Thank you.
B
12
S
2
Posts: 22
Reputation: 648

Post » Wed Jul 01, 2015 2:51 pm

Closing as not a bug.
Scirra Founder
B
397
S
236
G
88
Posts: 24,389
Reputation: 194,448


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests