Control Flow in Articulate

Apr 28, 2017

Is there a way to work-around control-flow like IF-ELSE statement in programming languages? 

I have a problem when I have a button which gives different results given the different variables but sometimes both of the triggers have met their demands for execution and from some reason the trigger which has last met their demands is executed, not the one I set first in the order.

I hope my question is not too messy. To sum up, I know limitations of software but can someone explain me more about trigger order and why does it sometimes behaves strangely or at least not as I expect it to do which is to run triggers by order.

4 Replies
Daniel Sposato (Philly)

Hi Luka,

Do you possibly have a trigger set to execute at the start of the slide and not the end? or vice versa? It's something I often overlook when I have triggers that seem to be executing out of order.

I really wish they just had a script window for JavaScript where we didn't have to publish out to use it. It would make developing a lot easier! Triggers are clunky when things start to get complicated.

Walt Hamilton

The basic problem is that there is no else in triggers. Many of us who have programming experience expect it to behave like that, but it doesn't. What happens is this: you have a series of triggers that execute when an initiating action occurs (user clicks, variable changes, etc.).

When that action occurs, ALL of the triggers are evaluated, NO MATTER WHAT. Those whose conditions are not met are evaluated to the point that the conditions are proven false, and skipped. Those without conditions or with true conditions execute, but do not stop the execution of the rest of the list. Thus if you have two conditions whose conditions are true, they both execute, in the order they appear in the list. Since the last one in the list executes last, those are the results you see.  The former trigger executes, but it sounds like the next one executes before you can register the results of the first one.

The only exception to this is the jump to another slide action. If you execute a jump, at that point the execution of the list will be interrupted. If you want to see the results of both actions, they have to be non-exclusive, persistent results, both of which can be simultaneously observed.

Otherwise, you have to devise a means by which each trigger has a unique condition.

Luka Povreslo

Thanks very much for explanation of what happens. I had button that shows different layers based on conditions. That's why I only saw the last one executed because layers are by default set to hide other layers. I guess I'll need to execute triggers with conditions that are totally independent of the other. Makes things more complicated but don't see better way to do it.

This discussion is closed. You can start a new discussion or contact Articulate Support.