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

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,

?:)

ups!! you are so right :)

thanks .....

views:1608 update:2011/10/17 21:25:02
corona forums © 2003-2011