(Last Updated On: March 14, 2024)

True/False variables in ActivePresenter 9 can return either true or false values. They can be used to track things that are right or wrong, on or off, clicked or not clicked, or even control two states of an object, for example, a toggle button. 

The True/False variable is one of the three variable types that ActivePresenter 9 provides. In this tutorial, you will learn how to use it as a condition to control the two states of a toggle button like this:

toggle button using true false variable

This tutorial covers:

  1. Design the Two States of the Toggle Button 
  2. Create a True/False Variable
  3. Assign Actions to Adjust the Variable

Design the Two States of the Toggle Button

A toggle button consists of two states, on and off. You prepare an image as the ‘on’ state then access the View tab > Object States to add the other ‘off’ state to it.

two states of the toggle button

To learn more about the Object States in ActivePresenter 9, refer to this tutorial.

Create a True/False Variable 

If you click on the toggle button, the two states will show up in turn. For that to happen, you need to use a true/false variable and change its value to true or false for each state whenever the toggle button is clicked. 

To create a true/false variable, you navigate to the Home tab, then click on Variables

Insert variable from the Home tab

In the dialog that appears, click on the green plus button at the bottom to add a new variable, select the TRUE/FALSE type, and define its initial value if any. Then, click Add & Close to finish.

create a true false variable

Assign Actions to Adjust the Variable

Now add actions to switch between the two states of the toggle button. 

Firstly, you select the button and navigate to its Properties pane > Interactivity > Events – Actions. Then add the On Click event and the Adjust Variable action. To enable the toggle function, you select the true/false variable created earlier from the list and the Toggle operator.

enable the toggle function

After that, you add the Change Object State actions and conditions corresponding to each state as follows:

change object state action using true false variable as conditions

Since the initial value of the variable is True, so you should assign it to the default ‘on’ state. And assign the ‘false’ value to the other state. 

For more information about events and actions, see Use Events-Actions to Add Interactivity to Courses.

That’s it! You have learned about how to use the True/False variable to make a toggle button. Hopefully, this tutorial will be helpful for you. Please feel free to download ActivePresenter 9 and try it out!

Download ActivePresenter

See also:

What is Variable?
Use Learner’s Name Throughout the Course with Text Variables
Use Number Variables to Create Click Counter
Add Interactivity to Courses with Events-Actions
Work with Advanced Actions Feature
Examples of Using True/False Variables