Skip to main content

Prototype - Interactions - Event listener & ElseIF conditional


Havard_Hammerstrom

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.

This topic has been closed for comments

3 replies

Rae_Gibbs

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.


gilgongo
  • 51 replies
  • August 2, 2023

@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.


  • 0 replies
  • October 31, 2023

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings