How do I preserve a slider's value even after the user interacts with other elements on the slide?

Jul 19, 2021

Hi everyone. I'm building a learning resource where the learner needs to adjust text size, colour and alignment. I've managed to create my idea pretty well (see attached), but I'm running into a glitch (most likely in how I structured things) where after the learner uses the slider to adjust text size and then goes to change alignment the slider remains in the same position, but the text reverts back to it's original state/size. Once the slider is moved (even a fraction) the correct size returns.

You can see what I'm trying to explain, in action, here

1 Reply
Judy Nollet

Hi, Julio,

The slider's value does stay the same until the slider is moved again. You could verify that by inserting a reference (for example: %Slider1%) on the slide.

The problem is that you have state changes triggered when the Slider1 variable changes. That means those triggers will only execute when the slider is moved. They won't execute when the user clicks an alignment or text-color button. 

You need to rethink the set up & triggers to ensure that the states will change even when the slider hasn't moved. 

Here's one suggestion: 

  • Create a T/F variable. For this example, let's call it INTERACT.
  • To each interactive object, add a trigger that toggles INTERACT. (The value doesn't really matter. The purpose is to have a variable change each time the user interacts.) 
  • Edit the state-change triggers so they execute when INTERACT changes. (Keep the conditions that check the value of the slider variable.)