Event propagation and stage:setFocus

I’m not sure whether this is a bug or not, but it seems that, after using stage:setFocus to capture all future touch events (as described in the documentation), it is no longer possible to terminate touch event propagation by returning true. Example:

[code]local function onTouch(event)
print("Runtime:touch -> " … event.phase)
end

Runtime:addEventListener(“touch”, onTouch) – Unhandled touch events fall through to onTouch

local obj = display.newImage(“ball.png”)

function obj:touch(event)
if (event.phase == “began”) then
stage:setFocus(self)
elseif (event.phase == “ended”) then
stage:setFocus(nil)
end
obj.x = event.x
obj.y = event.y
return true – Doesn’t terminate propagation of touch events after stage:setFocus(self) has been called
end

obj:addEventListener(“touch”, obj)[/code]

The initial touch of obj doesn’t fall through to onTouch, since obj’s touch handler returns true. However future touch events, even tough they’re captured & handled by obj, do fall through to onTouch. Is this a bug?
[import]uid: 10327 topic_id: 3551 reply_id: 303551[/import]

How did you solve this problem? I am having a similar problem as this.

What I did to solve it was to have an extra flag so that the map on the background of the focused object won’t be “dragged” along [import]uid: 11334 topic_id: 3551 reply_id: 13042[/import]

This bug has been fixed in the upcoming CoronaSDK build and should be out very soon. The bug number is 1341.

Thanks,
-Tom [import]uid: 7559 topic_id: 3551 reply_id: 13082[/import]