[SOLVED] onFocus problem with stacked objects

Hi,
Im building a card game where there is a deck of cards spread out in one row on the table with the cards partly overlapping.

I want to be able to move one card out of the deck by placing my finger on it and pushing it up.
When I put my finger (or mouse) on the card and push up, the wrong card ( the one below the card I have my finger on) moves.

Any ideas?

[code]

for i = 1, #cards do

local c = cards[i]

c:addEventListener(“touch”, selectCard)

end

function selectCard(e)

c = e.target

if e.phase == “began” then

display.getCurrentStage():setFocus( c )
c.y0 = e.y - c.y

elseif e.phase == “moved” then

c.y = e.y - c.y0

elseif e.phase == “ended” then

display.getCurrentStage():setFocus( nil )

end
end

[/code] [import]uid: 10100 topic_id: 15703 reply_id: 315703[/import]

try putting a
[lua]return true[/lua]
as the last line of function selectCard
it is to avoid touch event propagating further. [import]uid: 71210 topic_id: 15703 reply_id: 58019[/import]

Thanks that works! [import]uid: 10100 topic_id: 15703 reply_id: 59088[/import]