Well the input events are run top to bottom.
You have it so if you tap on either red circle it closes the menu, then third event runs because it’s not tapping on anything.
I thought maybe rearranging the events would be an option but that causes the menu to be instantly destroyed so you don’t see it.
But here’s this for a solution. Have one on tap event and have it do just one thing depending on what was tapped on.
on tap
-- touch is over sprite1?
-- -- close menu
-- else
-- touch is over sprite2?
-- -- close menu
-- else
-- — close menu
-- — create menu