Hello, when objects are layered, both events are fired no matter which object is on top… To easier explain what I am referring to please see the below code:
local objOne=display.newRect(130,200,150,150) objOne:setFillColor(1) objOne.id="one" local objTwo=display.newRect(200,280,150,150) objTwo:setFillColor(0.5) objTwo.id="two" local function oneFunction(e) if (e.target.id=="one") then print("objOne") else print("objTwo") end end objOne:addEventListener("tap",oneFunction) objTwo:addEventListener("tap",oneFunction)
You’ll notice when you click the white box or the gray box (outsides) the output is expected… However , when clicking in the middle (where objects layer) how do I prevent firing “white box’s” tap event when the grey box is tapped?