Storyline 1: Adding True/False Variables

Article Last Updated

This article applies to:

The true/false variable works just like it sounds: values can either be true or false. Some examples of where you'd use a true/false variable are:

  • Scene or slide completion: Adjust variable Section1 to true when user completes Slide 10.
  • Compliance acknowledgement: Adjust variable Agree to True when user clicks Submit button.

Let's take a look at a simple example using two buttons.

View the published example | Download the source file

If you're following along, I'm working in TrueFalse_START.story.

Step 1: Create a New Project Variable

We have two buttons on the slide, but we only need a single variable to evaluate.

  1. In the Triggers panel, click Manage project variables to create a new variable
  2. Click the Create a new variable icon
  3. Name your variable: Agree
  4. Set the variable type to True/False
  5. Set the value to False

Step 2: Insert a Reference to the Variable

This is not necessary, but it's a big help when working with variables. By inserting a reference to the variable, we can verify the variable is working the way we expect it to work. We'll delete the reference at the end of the project, but keep the reference for testing both the variable and the buttons.

  1. Insert a text box on the slide by going to Insert > Text > Text Box and clicking once on your slide
  2. Go back to the Insert tab this time go to Text > Reference. This brings up your project variables. There's only one variable so it will automatically be selected.
  3. Click OK to close the window and insert the variable reference.
  4. With the variable reference selected, increase its font size to something large, like 36

Let's preview our work. Click F12 or Preview to preview the slide.

Nothing much happens, but we can see the variable reference returned a false message. That's the default value we assigned when we created the variable. Next, we'll add some triggers to our buttons.

Step 3: Assign Button Triggers to Adjust the Variable

At this point, you've created the True/False variable, but it's not useful until we assign a trigger to evaluate it.

In the Trigger panel, click the Create a new trigger icon

  1. Action: select Adjust variable
  2. Variable: select Agree
  3. Operator: keep the current setting
  4. Value: change to Value and then select True
  5. When: keep current setting
  6. Object: keep current setting
  7. Click OK

Now that our first True trigger is set, we can copy and paste it for the False button.

  1. In the Triggers panel, select the trigger you just created
  2. Click the Copy selected trigger icon to copy the trigger
  3. On your slide, click the False button once to select it
  4. Return to the triggers panel and click the Paste the copied trigger to the selected object icon. This pastes the True button's triggers to the False button. You now only need to modify the False button's triggers
  5. For the False button's trigger, select the true value and select False from the menu

Preview your project and test your buttons.