If you've used Articulate Storyline at all, you have likely discovered for yourself that triggers can perform robust interactivity and calculations. However, triggers will take you only so far. Storyline can go beyond its built-in functionality by employing JavaScript, a standard scripting language used by web developers to create interactive web-based content.
Storyline allows you to execute JavaScript in your projects that perform several useful functions. For instance, you can attach a JavaScript to a button that allows learners to print a slide. Here's how:
Open or create a Storyline project and then insert a button on a slide (or select an existing button).
Create a new trigger, and from the Action drop-down menu, choose Execute JavaScript.
From the Script area, click Add/Edit JavaScript (the three dots) to open the Javascript dialog box. This is where you can type the JavaScript, paste it if you have already copied it to the clipboard, or link to it if the script is located externally.
Type window.print(); in the Javascript dialog box.
The text you just typed is about as simple as JavaScript gets. The word "window" is a browser object that calls the current browser window. The word "print" is a method that calls the browser print functionality. When you call a method you often need an array (arrays go between the open and closed parentheses). In this instance, there are no arrays needed but the parentheses are still required (even if empty).
Click the OK button twice to close both dialog boxes.
If you publish the lesson and click the button, the print dialog box will open and you'll be able to print the slide.
***
Looking for Storyline or Adobe Captivate training, check out these live, online classes.
Comments
You can follow this conversation by subscribing to the comment feed for this post.