Event.phase (cancel Problem)

Hi,

i swipe with my finger over the background to in/decrease some data.
On the top from the screen I have a header image (100px height)

Now when I swipe just over the background, all is fine and 'drag ended" is recognized.
But when I swipe over the background and end IN the header Image.
My last event.phase = Moved and thats it.

How could I recognize that the event is ended or canceled while ended outside from the background?

local function startDrag( event )
print (event.phase)
if (event.phase == “began” ) then

– get initial x,y

elseif (event.phase == “moved” ) then

– do something

elseif (event.phase == “ended” ) then

updatewert (actualwert)
-this should always be called when dragging is ended

  • either by lifting the finger or going outside of the area (in that case background)

end
end
background:addEventListener( “touch”, startDrag )
thx
chris
[import]uid: 4795 topic_id: 15910 reply_id: 315910[/import]

because you are not getting the event, they event is passed to the object where you have ended the move.

you need the setFocus() API to resolve your issue.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 15910 reply_id: 58867[/import]

ups!! you are so right :slight_smile:

thanks …

[import]uid: 4795 topic_id: 15910 reply_id: 58873[/import]