group conditional for all buttons clicked?

This may seem pretty basic but is there a conditional that will trigger once all buttons in a button group have been clicked on?

I tried just checking each button's state but the most recent click appears as "selected" so we never really have all buttons in "visited" state.

I keep reverting back to the old technique of tracking my clicks in a variable because I can't get it to work any other way.

Discussion (6)

You can do this with variables.

Create a variable (for example, MyVar) and put an action on each button that adds to the variable. Then include an action will run the action you want triggered after the variable conditions have been met. For example:

Button 1

On mouseclick >modify MyVar >add to variable a

On mouseclick >DO TRIGGER ACTION *if* MyVar contains A, MyVar contains B

Button 2

On mouseclick >modify MyVar >add to variable b

On mouseclick >DO TRIGGER ACTION if MyVar contains A, MyVar contains B

You can keep adding to the variable until every button you want users to click has been clicked. I hope this helps

Thank you

for your suggestion.

I am aware of the variable method and have been using it for years.

When Lectora 21 came out with improved button states and grouping, I assumed that there would be a built-in feature that could trigger an action once all buttons in a group have been clicked on. Unfortunately it doesn't seem to exist.

The variable method works perfectly, of course, but it's something that all new users have to learn on their own. If there was a conditional for

"all buttons in group x have been clicked on"

or even if each button had a

"visited

or

selected"

conditional it could cut out a few steps for us developers.

They should add some "negative Relationships" e.g. If Button 1 is "not normal".

You could say that in the Feature Requests area, of course.

This is a little cheesy, but if you add an action to each button to set it to visited before you do the conditional check, then afterward set it selected it might work the way you want.

On Mouse Click -> Set State -> This Object -> Visited

(do your conditional check here for visited states)

On Mouse Click -> Set State -> This Object -> Selected

Thanks

I never thought of that workaround. I'll keep it in mind next time instead of keeping a variable.