Javascript or advanced action help for incrementing variable names
I hope someone with Javascript skill can help me here. And it might also be possible with advanced action but I'm unable to do it.
I have a variable "randomNumber" that chooses 1-128 on slide enter.
I have a series of variables - "but_word_1", "but_word_2" "but_word_3" etc. all the way to "but_word_128". These have text string values.
I have another variable "spoken_word"
On clicking a button, I'd like Javascript to set "spoken_word" with "but_word_" + "randomNumber"
ex. if randomNumber is 5 - then window.cpAPIInterface.setVariableValue ("spoken_word", but_word_5);
Thanks.
