Copy link to clipboard
Copied
I found this function elsewhere on the forum:
cp.changeState("currentState,"newState");
So if my current state is "Normal" (Default) and the new state is called "Chosen" - I assume I can just add Javascript to a button with the line:
cp.changeState("Normal","Chosen");
And this should change the state on button click.
But this doesn't seem to work. Could somebody explain where I'm going wrong?
Copy link to clipboard
Copied
I need to do this too - any one solve this?
Copy link to clipboard
Copied
It's actually cp.changeState("objectName","newState");
Copy link to clipboard
Copied
Thanks for the reply -
cp.changeState("IR_Alpha","Normal (Default)"); <-- randomly tried this just in case... doesn't work
cp.changeState("IR_Beta","onState"); <-- works
cp.changeState("IR_Gamma","normal"); <-- doesn't work
cp.changeState("IR_Xray","Orange"); <-- works
So I can manipulate the states fine, but as the OP asked, how do you return to the default original state?
thanks!
Copy link to clipboard
Copied
Make it "Normal" (with upper case N; and without the " (Default)" suffix). Should work.
Copy link to clipboard
Copied
Result! 🙂 Works. Thanks!
Copy link to clipboard
Copied
You may also enjoy this resource with some basic JavaScript examples.