I want to assign an event listener to an object, whereby I get the details of the object via the event.target code.
As a test, I have a ball graphic with the following code:
ball:addEventListener ("touch", onPressBall )
And my listener code is as follows:
local onPressBall = function ( event )
event.target:addEventListener ("touch", onReleaseBall )
end
I am getting an “assertion failed!” error so assume my syntax is not correct. Any help much appreciated.
Essentially I want to detect when the user presses on the ball and then when they release the ball.
Thanks
Paul [import]uid: 7863 topic_id: 2219 reply_id: 302219[/import]
[import]uid: 7356 topic_id: 2219 reply_id: 6743[/import]