Set condition value to a defined variable?
Jan 29, 2020
I have a slide that contains several "mini-slides" that move horizontally like a filmstrip and previous/next mini slide buttons. I want to hide the previous button when the first mini-slide is viewed and the next button when the last mini slide is viewed. If any other mini slide is being viewed, both buttons are visible.
I have the previous button hiding as desired. However I cannot make the next button disappear. I am trying to set up a trigger that hides the next button when the mini slide index is one less than the total number of mini slides. The total number of mini slides is stored in a defined variable (via player.SetVar) called ms_length. My trigger checks first for when the mini slide index changes (which happens when the view-able mini slide changes). When it does it needs to compare that index with ms_length. My condition is if ms_index = value and I am trying to set value to ms_length but it is does not appear to be set up to handle variables in the value field. Is that true? Or is there a way to designate it as a SetVar variable?
In regular javascript windows I could define player then use GetVar but the value field does not allow injected javascript there does it?
Any help in this matter would be greatly appreciated! Thanks!
4 Replies
You can do this in SL, once the JS sets the other values, if you pass them back to SL.
You can use if ms_index = ms_length.
If that doesn't appeal to you, you can set some_variable = ms_length
Thanks. But I'm not trying to adjust a variable. Both variables are already set in javascript. I am just trying to use a trigger that has a condition that checks if X = (Y-1) and both X and Y are already set by javascript. The "value" field of the condition doesn't seem to accept a variable there - I believe it is interpreting it as a literal (a number or a string) and NOT a variable that represents a number or a string (it's a number in my case)
It seems to me you are asking if you can create a trigger to hide an object when a variable changes, if X = (Y-1). The answer is no, but you can Set Z to Y, then Subtract 1 from Z and hide the object if X = Z.
The if condition will accept a value, or a variable, just not an expression like Y-1.
If I'm not understanding what you are asking, attach the slide here, and I'll try harder to get it.
Thanks for the speedy reply. That sounds like a lot of jumping around. I've decided to just add yet TWO MORE variables (which is what I was trying to avoid), one for the previous and one for the next button and the vars are simply set to ON or OFF and then my trigger monitors that.
This discussion is closed. You can start a new discussion or contact Articulate Support.