AJAX to Array

Get help using Construct 2

Post » Thu Jun 20, 2013 6:05 pm

Hey everyone !

I'm in the middle of creating something new , but I got a small problem

Here's what I want to do , I've put two JSON codes in each of the text files , and I'm looking to load them in the roomlist with a loop

Everythings working fine till now , call the project files , but then , In the loop , When I enter the two codes in the array , seems like they come back as 0 as if they weren't strings , I've added a text file for debug purpose and the capx below

AJAX to Array

Thanks for reading !
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Thu Jun 20, 2013 8:34 pm

Went out of page ...

Seems like @Yann is online
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Fri Jun 21, 2013 12:57 am

Bump again . it went out of the spotlight again !
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Fri Jun 21, 2013 1:30 pm

Bump
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Fri Jun 21, 2013 2:39 pm

What does go wrong exactly ? You want to store the JSON data in the array but it's not storing it as a string ?
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Fri Jun 21, 2013 2:42 pm

yeah , it always returns a 0 in the array , even if it works with tokenat(LastData)

@MagistrossWhiteclaws2013-06-21 14:44:13
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Fri Jun 21, 2013 2:47 pm

Okay , just to reproduce the issue ,

Action with "On Up Completed" Condition ; Set text to tokenat(AJAX.LastData,0,"|")

Returns the JSON code

But ...

RoomList ... Wait a sec ...

Found it !

It's just that roomdata is not supposed to host those codes ,

Just replaced roomdata with roomlist and done

Thanks for caring ;)
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Fri Jun 21, 2013 3:24 pm

Ah ! Of course, if you test the wrong array, it won't return anything ! :P
B
69
S
28
G
24
Posts: 977
Reputation: 18,739


Return to How do I....?

Who is online

Users browsing this forum: NN81 and 16 guests