In a nutshell I have some code similar to this:
ball:addEventListener( “touch”, function( event )
if event.type == “began” then
ball.alpha = 0.5
elseif event.type == “cancelled” then
ball.alpha = 1
end
end)
The problem is that when a user presses down on the ball, then drags their finger off of the side of the ipad, or off of the ball itself, I get no further events telling me that the touch was actually cancelled. That is, the last event that I get from that ball is “moved”, but since I never see a touch canceled event I never have the dimming removed from the ball.
I’ve thought of a way around this where I could set an event listener on my background that tells me if the user dragged their finger off of the ball and ended a touch on the background, but I can’t think of any work around at all of the user going off of the screen, since once their finger is off of the screen I can get no further events.
Is this a bug in the cancelled event type or am I misusing it? Is there a better way that I should go about solving this problem?
Thanks! [import]uid: 70 topic_id: 782 reply_id: 300782[/import]