Randomized spinning wheel

Nov 21, 2012

Hi All,

Whilst surfing the community forum, I sometime come a cross, questions on gameplay, randomizing functions...
So I thought why not create something that combines both, the result can be found in attached source file.

It uses a randomizer function, so it might be that you have to click spin more than once ...


This is how it looks like

Please feel free to alter and use whatever part you want



36 Replies
Jackie Van Nice

Hi Vanita!

Here's how you can see the actual JavaScript:

  1. Download Geert's "spinning_wheel.story" file above.
  2. Open it, and on the main slide, select the Spin button. In the trigger panel you'll see its trigger says "Execute JavaScript when the user clicks".
  3. Click to edit the trigger. Where it says "Script", click on the ellipsis (see image below) and an editing window will open.

    Edit JavaScript

  4. This is where you'll see the JavaScript (and in fact - here it is!):JavaScript

I hope that helps!


Jackie Van Nice

Hi Becky!

Leslie's right - Geert's file is your best bet. Examining it is where I got 100% of my information about the spinning wheel, the javascript behind it, and how to make it work.

I seem to recall it was easy to break when I tried to recreate it in a new file, so I ended up literally using Geert's file as the basis for mine and simply built on top of it. Way easier than trying to pretend I suddenly knew the first thing about javascript. :)

I found that proceeding with baby steps - just changing one image or one layer or one bit of javascript at a time, then testing it to be sure it still worked - was the way to go. It takes care and patience, but the result is a happily spinning wheel.

Amar Kulshreshtha

Hi All Heroes,

I have created the same spin wheel in storyline 2 using javascript and its working fine. User will get a random number on every spin also i have added some questions in this spin wheel game. Try it and enjoy...

Thanks and here is the demo link:


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