Multiple Images receiving one tap Event

Please assist me,

I have different image with tap event, The images are close to each other, some overlap each other.

I want only one event to respond at a time BUT is working like that.

Whenever I taped, all the images within the tap execute their actions. I WANT IT ONE AT A TIME.

Please how can handle this; for one image to respond at a time?

I think you should add a 

return true

at the end of the touch function.

For example 

local btn1 = display.newRect(0,0,100,100) local btn2 = display.newRect(0,0,100,100) btn1:setFillColor(0.5) btn2:setFillColor(0.75) btn1.x = display.contentWidth/2+25 btn2.x = display.contentWidth/2-25 btn1.y = display.contentHeight/2 btn2.y = display.contentHeight/2 local function onTouch1(event) if event.phase=="began" then print("touched1") end return true end local function onTouch2(event) if event.phase=="began" then print("touched2") end return true end btn1:addEventListener("touch",onTouch1) btn2:addEventListener("touch",onTouch2)

Thank you.

return true worked.

I think you should add a 

return true

at the end of the touch function.

For example 

local btn1 = display.newRect(0,0,100,100) local btn2 = display.newRect(0,0,100,100) btn1:setFillColor(0.5) btn2:setFillColor(0.75) btn1.x = display.contentWidth/2+25 btn2.x = display.contentWidth/2-25 btn1.y = display.contentHeight/2 btn2.y = display.contentHeight/2 local function onTouch1(event) if event.phase=="began" then print("touched1") end return true end local function onTouch2(event) if event.phase=="began" then print("touched2") end return true end btn1:addEventListener("touch",onTouch1) btn2:addEventListener("touch",onTouch2)

Thank you.

return true worked.