It’s pretty easy to change a multistate object using Advanced Actions. However, if there are a high number of states and you want specific interactions on specific states, this can be very time consuming. Using JavaScript, you can very quickly change the state of an object and it is saleable to larger projects.
This video provides you a quick overview on how to apply some JavaScript to a screen and buttons to change the state of a multistate object. The file for this project can be downloaded at
https://elearning.adobe.com/2020/03/tour-of-kia-project/
want to explore javascript applications further!
thanks for this great info!
did not know about the javascript application
Have a look at:
http://blog.lilybiri.com/about-state-commands-and-a-progress-bar
Those commands ‘Go to Previous State’ and ‘Go to Next State’ were added also to the Advanced Actions dropdown list on my insistant feature request. They were not available with the first versions including Multistate objects. I know that I’m talking to JS experts, but just post this comment for other users. Lot still ignore it. Those commands are timesavers, especially when creating progress bars.
This is one of the main reasons I went the JavaScript route – saving time.
That said – just a thought, Phil.
If your left/right turn arrows are always in a next/previous linear relationship for turning the car, what do you think of using the following on each button respectively?
cp.goToNextState(“KiaCar”);
cp.goToPreviousState(“KiaCar”);
These should just continue to cycle around through all of the states regardless of which direction you go.
You only need to make sure that your states are all in the order you want them.
It would save a few lines of code, too.
Good thought Greg. Thanks for sharing. I wasn’t aware of that function. It’s another set of functions not covered on https://helpx.adobe.com/captivate/using/common-js-interface.html
I’ll keep these functions in mind next time I make something like this.
Cheers.