I have a problem with the click event on overlayed sprites.
I have a sprite that works as a background of a section of the page, with other several sprites over that background: every time I click on the background an error function should be triggered, if I click on another sprite, instead, e success function should be triggered.
The problem is that the click event trigger the success function AND the error function.
I figured out some tricks to avoid this, such as write a condition like
"click on background
not click on other sprites"
In this case the actions should be performed only if the click event was triggered on the background only.
In any case this fix isn't a real solution, because if I have a lot of different sprites with several different functions the amount of conditions will increase very badly.
Is there any way to stop the propagation of an event only to a given sprite?
I simply want specify a set of actions to be performed if the top sprite is clicked and a different set of actions to be performed if only the background sprite is clicked.