Hi I’m a bit stuck on why this code is not working.
I keep getting the error: ERROR: nil key supplied for property lookup.
My code looks a bit like this:
[code]
local counter = 0;
local count = 5;
local buttonListener = function( event )
if “ended” == event.phase then
counter = counter + 1;
event.target:removeEventListener( “touch”, buttonListener )
print( “addToCounter-”…counter )
if (counter == count) then
print( “Finished” )
counter = 0
Runtime:dispatchEvent({name=counterReached})
end
– we handled it so return true to stop propagation
return true
end
end
local bubble = display.newImage( “images/bubble.png” )
– connect buttonListener
bubble:addEventListener( “touch”, buttonListener )
[/code] [import]uid: 91921 topic_id: 19010 reply_id: 319010[/import]