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.
Follow up: Is there no JS code that I could use to reset the states of 10 objects in a slide to "Normal" (essentially resetting the slide content on demand, via a button push).
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.
No, since it is html based. Actually that is exactly the reason i use Javascript for things like this...to avoid Flash alltogether. ( i worked years as Flash developer..loved it, still do, but its a no-go nowadays. SL should make sure output can be completely flash free too )
Looking at the corporate world flash is going to be used for a long time yet, a lot of my clients still use IE8, and 9. I would love a world where flash did not exist but it is going to have a prolonged death.
Yes, true. Somewhere Adobe missed the boat. I did like Flash, and did develop years games and more in it. But for now...i can manage without it. With Javascript , JQuery and Greensocks Tweenmax i can do anything exactly as i want it.
7 Replies
you could fire state changes by adjusting variables, and then use onside triggers to change state when variable change
Phil,
Interesting approach!
Follow up: Is there no JS code that I could use to reset the states of 10 objects in a slide to "Normal" (essentially resetting the slide content on demand, via a button push).
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.
Will this work in the flash output as well?
No, since it is html based. Actually that is exactly the reason i use Javascript for things like this...to avoid Flash alltogether. ( i worked years as Flash developer..loved it, still do, but its a no-go nowadays. SL should make sure output can be completely flash free too )
Looking at the corporate world flash is going to be used for a long time yet, a lot of my clients still use IE8, and 9. I would love a world where flash did not exist but it is going to have a prolonged death.
Yes, true. Somewhere Adobe missed the boat. I did like Flash, and did develop years games and more in it. But for now...i can manage without it. With Javascript , JQuery and Greensocks Tweenmax i can do anything exactly as i want it.
This discussion is closed. You can start a new discussion or contact Articulate Support.