Execute JavaScript

Nov 05, 2019

Based on some searching of the forums, it looks as though Storyline has the capability to execute JavaScript based on some sort of user interaction.

For example - Suppose a button is on the screen and the user clicks the button.
This will trigger a small script containing many things such as setting variables, showing and hiding items, changing their state, and running conditional checks.

changeState("circle","state2");
++variable;
hide("object4");
show("object2");

if (variable2==3) {
$("#object2").animate({left: "+=50px"});
}

I realize the above code ideas would probably not be the right way to write stuff for use with a Storyline project but hopefully they serve as examples that make some sense.

I wanted to verify if this is possible and, if so, can someone point me to a document for specific commands for use with Storyline?

 

2 Replies
Greg Stager

I did come across that article during my initial searching. I started a trial and hoped there would be something a bit more comprehensive to minimize the amount of pouring over code just to discover how it works.

From what I have learned so far - a simple incrementing of a variable which I can accomplish with    ++myVar;   will require a bit more work.  I prefer to bypass the GUI where possible and simply state what I want to have happen without all the clicking through a wizard.

I appreciate the response.

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