Display Object With Touch Everywhere?

Hey guys!
So, I’m trying to make a simple touch event on the Circle… The touch event is fireing everywhere I touch…! Nothing in the terminal either… anyway… Here’s that little bit of code xD

[code]
function pausebutton:touch(event)
if (event.phase== “began”) then
stagenum= 2
end

end

Runtime:addEventListener(“touch”,pausebutton)
``
Thanks! [import]uid: 95032 topic_id: 22980 reply_id: 322980[/import]

The code looks a bit odd…could be wrong, but shouldn’t the function be like this?

local circle = display.newSomethingorother()  
  
local function circletouch(event)  
 if event.phase == "began" then  
 stagenum = 2  
 end  
end  
  
circle:addEventListener("touch", circletouch)  

Anyway, the other thing to point out (maybe the only one that matters to you) is that the action is occurring when you begin the press.

Generally speaking you save actions for event.phase == “ended” because otherwise it occurs whenever it detects a new press - no waiting for a release or anything.

Anyway, just a shot in the dark. [import]uid: 41884 topic_id: 22980 reply_id: 91772[/import]

+1 richard.

A Runtime listener for a button may be a little excessive :wink: [import]uid: 52491 topic_id: 22980 reply_id: 91875[/import]