Need Help with Integer-to-Variable

In short, I need to be able to set/store an integer from a button on my webpage. This button also triggers a lightbox containing a slideshow. The code in the lightbox must then retrieve the stored integer, the value of which is used to change slides in the slideshow.

Is there another way to get/pass this value/integer without adding a collection?

I had this working, but I was using if statements. I could also use a case statement. However, in either case we’re talking a lot of extra code. Passing the integer simplifies things a lot, resulting in many fewer lines of code.

Lastly, I simply set a new session variable. Then, I “let” a variable to get the stored value and then put this value in the parentheses of the “changeSlide” operator. . .

Didn’t work.

There must be a way around this. I ran into this problem with indexes in the Pro Gallery. You can retrieve items in an index, but you can change the index your viewing in the Pro Gallery by any coded means. Hence my use of a slide show.

Again, I can get it to work. But there’s just so much extra, unnecessary code.

Thoughts???