Forum Discussion

DarrenNash's avatar
DarrenNash
Community Member
5 months ago

Showing a button in a slide when several variables are changed.

I am looking for an easier work around for this issue as I have been using this method a long time and and it seems a bit daft to do it this way so if there is an easier way, please let me know.

So, I have 4 buttons on a slide. Each button when clicked, opens a layer, so 4 buttons, 4 layers. The main slide has a hidden continue button so the users but click on ALL 4 buttons, and then close the layer. When the user clicks on the close button for each layer a Variable is changed from False to True, wo when all four layers are closed all 4 variables are now set to true. When all of the variables are true then the Continue button shows.

To do this I have to create four sets of the trigger conditions shown below. This works but its a bit overkill?

My issue is , is that the trigger setup is not fit for this purpose, as it only works if the variable changes based the specific variable, so 4 combinations have to be created due to the limited ""When variable Changes". It shouldn't only be when it changes as it doesn't always change.

The logical correct trigger would be:

Set state of Button1 - "Continue" to Normal

When disclose1 = True

and disclose2 = True

and disclose3 = True 

and disclose4 = True

 

No condition that the variable has to change for the trigger to work, as the variable may already have changed and so it wont work. It was also suggested to use the "When the timeline starts" but that only works of it is coming from a different slide, but the timeline has already started when using layers.

Any logical workable solutions instead?

 

4 Replies

  • Here's an option. Have these triggers run when the user clicks the button that closes a layer: 

    • Change [the associated variable] to True.
    • Change the state of Button-"Continue" to Normal with four conditions: that disclose1 = True, disclose2 = True, disclose3 = True, and disclose4 = True.
    • Hide the layer.
  • Nedim's avatar
    Nedim
    Community Member

    A long time ago, I found myself in a situation with a dozen buttons, each linked to a layer. Each button was supposed to set a variable to True when the associated layer was visited. To show the "Next" button, I created 12 triggers, each corresponding to a variable change. As you said "this works but its a bit overkill".

    To simplify things, I turned to JavaScript logic, where I could use a timed action to perform an action within a specified duration.

    To implement this, I inserted an offstage shape and applied a motion path to it. The motion path was set to last 0.10 seconds, when the timeline starts. Once the animation was complete, the shape would move along the same path, repeating in a loop. This created a reliable time reference that I could tie to my "When" action, allowing me to execute other actions every 0.10 seconds under specified conditions.

    I then set a trigger to change the state of the "Next" button to Normal when the shape's animation completed, but only if all the variables (i.e., all layers had been visited) were True. Instead of using 12 triggers, I ended up with just 3: two to keep the shape running in a loop and one to set the button state to Normal under specified conditions.

    There are so many scenarios where this approach could come in handy to replace JavaScript’s setTimeout function. For example, instead of using setTimeout to execute actions after a fixed duration, you can use the motion path and loop method to trigger actions at regular intervals.

      • DarrenNash's avatar
        DarrenNash
        Community Member

        cheers, I have tried that in the past, even used a hidden layer with a 5 frame timeline and an off screen object and set it to basically the same based on when the timeline ends on the layer...but they are all awkward workarounds instead of Articulate addressing the needs to make better trigger options.