Touch event only fires once

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?

How is bkg being created?   Your code looks right to me.

I found what it was happening: the Mac Console doesn’t show you any click anytime you click. It creates a sort of buffer, then after a while (a variable number of seconds) it tells you how many time the last event happened (being the click event the last fired event).

Thanks for your kind reply.  

How is bkg being created?   Your code looks right to me.

I found what it was happening: the Mac Console doesn’t show you any click anytime you click. It creates a sort of buffer, then after a while (a variable number of seconds) it tells you how many time the last event happened (being the click event the last fired event).

Thanks for your kind reply.