Hi,
I have the following function, that I want to reuse
function clock:touch(e)
if (e.phase == "began") then
-- doSomething
elseif(e.phase == "ended") then
--doSomething
end
end
clock:addEventListener("touch", clock);
Can i reuse the code on multiple objects, by getting the name of the object touched? dog:addEventListener(“touch”, clock);
Is it possible to get the name of the object “touched”, right now i know you can get the name of the event.
Thanks
[import]uid: 120979 topic_id: 21406 reply_id: 321406[/import]
