Skip to main content
Question

Changing a word by clicking an arrow button

  • November 24, 2023
  • 3 replies
  • 424 views

Joran_Vlaeyen

this is waht i want:
i want to have an arrow button that changes a word to the next word in the variable list but i also want to have a arrow that changes it to it’s previous but i don’t know how to make this

can someone help me or tell me if it’s possible

This topic has been closed for comments

3 replies

fernandolins_cs

I don’t think you can do it with variables at this time, because you can’t get the index of a variable in a collection, nor can you create array objects.

What you could do is create a component with, say, 10 variants, each variant would load a different a String variable named 1 through 10 into it, and then the arrow buttons would just change to the next/previous variant in the component. If you have less than 10 words, for example 6, you could add a condition to the arrows to check if the next variable is empty, and if it is, it goes back to the first variant of the component where it loads the first word, so that you can change the amount of words (up to 10 in my example) and it would still work.

The list of variables would look something like this:
String variable name - String variable value
1 - Word A
2 - Word B
3 - Word C
4 - Word D

10 - “” (Empty string)

The Condition on the button, something like this:
If ([10] == “”) then Change to Variant 1

where “[10]” is the string variable named “10” in your variable list.


Joran_Vlaeyen

thank you but i have one more question about the arrows themself ow do i make them change the word. because when i try the arrow changes to the next word and not the first word


fernandolins_cs

The arrows do not change the word. The arrows change to a different variant, and that variant’s text box has its contents connected to a variable.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings