Prototype - Interactions - Event listener & ElseIF conditional

The new variable system is great, but using the conditional to change a different element can be somewhat tedious when you have multiple objects that need to run the same check. Would it be possible to ad an interaction choice of “Event listener” which updates with every new action performed?

Let’s say I have 10 products I can add to cart. And for each product i have to add a conditional which does the following: If “ItemsInCart” > 0 then “BuyButton” set True. The more products I have, the more I have to update.

What if Instead could just add an Event listener once, on the Button itself. Which would check the same conditional. And auto-update itself.

Also: Would it be possible to get an option to add an ElseIF statement to the conditional? Sometimes two options isn’t enough.

1 Like

This would make such a huge difference. It’s so hard to recall each interaction that has a condition set. It would be so much easier to maintain with event listeners.

1 Like

@Rae_Gibbs Also a good point about it being hard to remember which things have what set on them. It’s a pity everything has to be “proxied” by variables. It would be nice to have the option of directly referencing objects, eg “Set [shape] to [state]” or “Set [text] to ‘[string]’”). That way, you might have, say, a button controlling a bunch of things but be able to manage all of those interactions from the button.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.