How to set an object state with a variable?
Hi all! I am working on a project where I want the user to choose an avatar at the beginning, and have it appear throughout the slides.
So far I have created a 'hair' object with different object states for each hair style. I can create a button with an advanced action that sets the object state on the first slide, but I'm a bit stuck displaying the correct object state on subsequent slides. It feels like I need to put the selected object state in a variable, then use the value of the variable to set the object state in each slides On Enter but I can't figure out how to do this. When I choose the 'change state of' action in my advanced action, I can choose the object name and the state, but I can't seem to use a variable value for the state.
I have also tried executing the following javascript but nothing seems to happen - I'm not sure if I need to put this in a function or if it can be executed straight from the script window and my syntax is wrong?
hairstate=window.cpAPIInterface.getVariableValue("v_HairSelection"));
cp.changeState("ImageName",hairstate);
If anyone could offer suggestions it would be greatly appreciated!
