Using JavaScript to add the sum of variables in Storyline 360

Jan 28, 2021

You can use JavaScript in StoryLine 360 to show the sum of three different variable values. See demo here.

I have also included the SL file so feel free to download and see how it is done! Cheers Gerry.

6 Replies
Marcus Nielson

Thanks for this Gerry. It really helped me skip the rigorous learning step and copy what you'd done :D. 

I did notice that the numeric entry fields seem to inherently save as strings rather than number values when importing into the Javascript code. My solution at the moment is just to have a trigger within Storyline that sets the numeric value in the field to a different variable (that is set to be a number) and then use that in the code. 

That seemed to work. I wish that the Numeric Entry field in SL would actually keep the value as a number but what can you do?

If anyone else has a more elegant solution that uses Javascript to do it for you.