Performing calculations in Storyline

Jul 26, 2012

Hi all: I have a request from a client to create a simple calculator they can use in their training.  If you're a statistics geek, it's a Cp and Cpk calculator.  Basically whether or not a process is capable of meeting the requirements set down.  Mathematically it means the learner will input three data values and I have to subtract the second from the first and divide the result by 6 times the third value and then show the result. 

There is so much good stuff on the web site I'm finding it hard to just find a basic tutorial on doing calculations in Storyline.  Any help would be appreciated



4 Replies
Steve Flowers

Hi, Chuck -

Certainly possible in Storyline. If you're not averse to using JavaScript I think that would be the easiest and most elegant pathway to getting the calculator finished. Keeping in mind this method won't work at all in the iOS player on iPad and won't work yet in HTML5 output. 

Fields with correlating variables:





Calculate with trigger (JavaScript Trigger):

var player=GetPlayer();

var jsVal1=player.GetVar("val1");

var jsVal2=player.GetVar("val2");

var jsVal3=player.GetVar("val3");

var calcResult=(jsVal1-jsVal2)/(jsVal3*6);


Chuck Nemer

Hi Steve: Thanx for the quick response. I understand the logic of your example. A couple things. Where do I do this in Storyline? Is it in triggers? Do I create a trigger and embed this? the other thing is I bought storyline because it does it's programming behind the object for me. I love programming and get it, but it's not a good use of my time work wise to learn java. I get your example, the logic, and the flow. Can't visualize how I'd do it and where in Storyline

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