Change shape state based on variable value

Hi all,

I'm trying to change the state of a shape based on a variable value. For example, if the variable value is 5, then the state of the shape should be the one that's named 5, if the variable value is 42, the state should be the one named 42 etc.

I know I can set up a trigger for each value/state but i've got 100 states it could be (named 1 to 100) and I don't really want to set up 100 triggers for each shape! Is there an easier way to do this either within storyline or with some javascript magic?

1 Reply