Hi, even if I’m a developer, I’m a Corona noob, so I beg your pardon in advance if I’m asking something trivial.
I’m modifying a KWIK project and I need to bind a graphical object (an image) to an event, so that when I touch it (click), the event fires.
The code I use is the following:
bkg.id = “appBackgroundImg”
local function onObjectTouch( event )
if event.phase == “began” then
print( "Touch event began on: " … event.target.id )
end
return true
end
bkg:addEventListener( “touch”, onObjectTouch )
I read the print message in my Mac console.
Problem is this event (in simulator, I don’t know once deployed to a regular device) only fires the first time I click. In any other case it silently fails or it is cancelled.
Can you help me understand what’s happening?