Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Articulate Storyline

You're reading from   Mastering Articulate Storyline Learn how to push Articulate Storyline to its limits and create breath taking stories by deepening your understanding of the product's capabilities!

Arrow left icon
Product type Paperback
Published in Jun 2016
Publisher Packt
ISBN-13 9781783550913
Length 288 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (10) Chapters Close

Preface 1. Before You Begin 2. Refresher of Key Concepts FREE CHAPTER 3. Creating a Content-Rich Story 4. Engaging Your Learners with Interactivity 5. Using Variables, Conditions, and JavaScript 6. Assessing Learners 7. Preparing to Publish Your Story 8. Becoming More Creative 9. Streamlining Your Development

Fun uses for JavaScript in Storyline

The following sections will teach you about the fun uses of JavaScript in Storyline.

Generating a random number

Generating a random number may not be the most practical use for JavaScript in Storyline for educational purposes, but it has the potential to be useful and it's pretty easy to pull off.

For ease of use, download JavaScript7.txt and copy/paste the script into the Storyline JavaScript field.

To achieve this effect, you will first want to design your slide. Here, we have a text prompt for the learner and a button, which will execute the JavaScript:

Generating a random number

Next, access the Manage Project Variables panel and add a new variable with the following parameters:

  • Name: randnum
  • Type: Number
  • Value: 0

Now that we have our variable created, we need to add a reference to the variable. This has been added next to the button:

Generating a random number

Finally, we will add a trigger to the button that will execute the JavaScript needed to generate the random number. Add a new trigger to the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image