Set text to Array.At

Get help using Construct 2

Post » Tue Jun 25, 2013 3:53 pm

Hi,

I have a XY Array which in the X I save questions and in the Y I save the answers. I generate a Random number to choose the question that it is showed in a text box. I save my Random number in the variable Rnumber, and then I write this:

Text: set text to (Array.At(Rnumber))

That is the way to only show the elements that are saved in the X axis, but sometimes it shows me the Y axis, that is the answer. I need some help to only shows the question (X axis).
B
6
S
2
Posts: 61
Reputation: 1,099

Post » Tue Jun 25, 2013 3:58 pm

The simpliest way is to specify a second parameter in Array.At, to tell what Y you want.
Want the question ? Array.At(Rnumber,0)
Want then Nth answer of the Rnumber question ? (Array.At(Rnumber,N))
B
17
S
8
G
4
Posts: 473
Reputation: 6,191

Post » Tue Jun 25, 2013 4:05 pm

I tried that, but in the position (0,0) it always return the answer, I dont know why.

Thanks for answering so fast :)
B
6
S
2
Posts: 61
Reputation: 1,099

Post » Tue Jun 25, 2013 5:30 pm

I'm not fast this time ^^
Do you have a capx for me to see? It would be easier to help :)
B
17
S
8
G
4
Posts: 473
Reputation: 6,191


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 36 guests