Changing the state of an object with JavaScript

May 09, 2014

Is it possible to change the state of an object using JS?

If so, what would the code look like (sample) or where can I find clearly written instructions or articles that explain how this is done?

The SDK documentation is as clear as mud for a "non-developer" like myself.  So far I have been able to figure out how to create variables and assign values to variables using JS but Object State Changes is a tough one.

Thanks to anyone that can help!

7 Replies
Math Notermans

In fact you can access any object in SL2 with Javascript. Biggest problem is the names they get when published. You cannot see them upfront ( or set them upfront ) so you have to inspect your published html and use Firebug or something like that to get to know the DIV ids of the images used in the states. In your html they are something obscure like: 6BNtZSkjgeM.6WGk1PCGuBD.6rIf6IitaiQ

If you know those names, you can use JQuery or any library of choice to show/hide these states at will.

This discussion is closed. You can start a new discussion or contact Articulate Support.