I declared the arrays as global variables in a new on scene load js. “init()”
You should read MDN Switch about switches and how they work. Yours was completely wrong in it’s setup.
In ours once we switch to the right case, we only need to determine which colours or names we are going to use and set the global array variables accordingly.
When the second set of buttons ( name, color) calls their script; that script will be able to read those global array variables. So we do not need to do anything there with them apart from tell the textfields to use them.
MarkExampleButtonIDSToVariableName-Part2.hype.zip (28.6 KB)
0 = 1
And so on.
So in the line.
hypeDocument.getElementById("text1").innerHTML = eval([buttonID]) ;
we are saying:
get the element named “text1”, and set it’s innerHTML to: item 1 of some array.
The item number is determined by the very last .
eval([buttonID]) is just turning a string into a variable . And we have to use the  on the end of “buttonID]” or we will get the name of the array instead of to its items. I think this is only because we are using eval(). But someone with better knowledge may be able to clarify but suffice to say I am only pointing out as an anomaly to my explanation of indexes.