Although not used as often, the “=NotAssignment” (also known as “toggle”) variable/trigger can be a great way to help you create engaging interactions for your learners! I was recently asked about a potential use for this trigger in class and, although there are other ways you could use it, I came up with the following example. We’re hopeful that this example and blog post not only accomplishes my goal of showing the use of the trigger, but also succeeds in wishing you happy holidays!
One Button Versus Two
A popular use of the toggle variable/trigger combination is to create an “on/off” effect, where the learner causes an event to happen by pressing a button and then causes the opposite event to happen by pressing the same button. (Many developers will use two different buttons to accomplish the same thing.)
Once you have decided to use the toggle method, the first step is to insert the button you would like to use to control the event. In this example, we are using this light switch/box as our button.
You will also want to create a Selected state for your on/off button. The Normal state for this button will be “Off” and the Selected state will be “On”.
Insert the Item You Will be Changing
Now is time to insert the content that will be switched “On” and “Off” by the button. In our case, we will be turning on the lights for the Christmas tree.
You will also need to add “On” and “Off” states for this item. Consider that this item has a normal state (the way it normally appears). I chose to have the normal state of the Christmas tree also be my “Off” state, and then created an “On” state that we will trigger shortly.
Note: You could have also used a Selected state to show the light being on, but it would allow the learner to also click on the Christmas tree.
Build the True/False Variable
The “=NotAssignment” trigger needs to have a True/False variable associated with it in order to work. Therefore, you now need to build the variable.
Build the Triggers
There are three triggers that are associated with this build. The first trigger is the “=NotAssignment” trigger we have been discussing.
Now, the True/False variable will have a value of false when the learner clicks the button once, and will have a value of true if the learner clicks the same button a second time, and so on.
Then, we can build the remaining two triggers. These are the “Change State” triggers we need to allow our light to switch from a state of being “Off” to a state of being “On” and back again.*
Note: These triggers will also need to have conditions associated with them, such that the item will turn “Off” when the True/False variable is set to false and vice versa. In our example, we chose to use “When the User Clicks” as the event trigger, but you could also use “When Variable Changes.”
Add the Background Items
Once the triggers are completed, you can add additional content and background images if you like. I have added a video of snow from the Content Library.
Preview the Slide
Preview the slide to be sure all is working properly. See a live example of the concept here or download your own copy of the source file at this link. You may want to add some entrance animations or audio onto your slide for additional emphasis. That’s it!
Note: Remember, the value in using a variable is that it will carry throughout the course until we change that value again. In our case, this means the user would not have to turn the tree back on in subsequent slides. To accomplish this effect, just add a trigger that causes the tree to be in the previously chosen state when the timeline of the slide starts.
Hopefully this gives you some ideas on how to utilize the toggle variable and associated triggers in your eLearning courses. We also hope this turns on a few light bulbs for you! Remember, Storyline 360 is a terrific tool and, as we’ve said before, there really is no limit to how creative you can be! Good luck in your future builds and let us know what questions or comments you have.
Update: Please note that the interface of the faster new trigger workflow (in Storyline 360 update 3.33.20625.0 or later) will appear slightly different! While the process is the same, this article uses screen captures from the classic trigger workflow.