Dear corona community,
I would like to listen for both tap and touch events on the same object and do different transitions to it, depending on whether it was a touch or a tap. Problem: The tap events also fire the touch listener, so two transitions are happening.
Following the tutorial here: https://coronalabs.com/blog/2013/10/01/tutorial-taptouch-anatomy/
I can have both a tap and a touch listener on the same object and use something like this:
function comboListener( event ) if ( event.phase ) then print(" TOUCHED!" ) votePic1(event) else print(" TAPPED!!!") focusPic1(event) end return end object:addEventListener("touch", comboListener) object:addEventListener("tap"; comboListener)
to distinct between the two.
Problem is: If I just mouseclick on the object in the simulator, console prints out:
14:32:17.552 TOUCHED! 14:32:17.552 votePic1 14:32:17.643 TOUCHED! 14:32:17.643 votePic1 14:32:17.643 TAPPED!!! 14:32:17.643 focusPic1
So, touch event gets fired twice, tap event gets fired once. What am I doing wrong here?
