Hello,everybody,
I am encounter difficulties.
local Fire = display.newImageRect(“fire.png”,90,90)
local function FireFrame()
print(“Fireuse”)
end
local function TouchFire(event)
if event.phase == “began” then
Runtime:addEventListerner(“enterFrame”,FireFrame)
elseif event.phase == “moved” then
if event.x >= Fire.x - 45 or event.x >= Fire.x + 45 or event.y <= Fire.y - 45 or event.y >= Fire.y + 45 then
Runtime:removeEventListerner(“enterFrame”,FireFrame)
end
else
Runtime:removeEventListerner(“enterFrame”,FireFrame)
end
end
Fire:addEventListener(“touch”,TouchFire)
But when I fast touch over the moved condition , No trigger the Runtime:removeEventListerner(“enterFrame”,FireFrame).
I think I have not continued monitoring because my contact left Fire.
So I changed the condition from 45 to 40 but the situation is still.
If you leave Fire then you should execute “cancelled” but there is no.
How can I solve this problem?
Thank you.
您好 我所遇到的問題是 我的圖片是90,90的大小
我希望我在圖片上都會執行Frame,離開時則會取消Frame的監控
但當我的手指快速離開時他並沒有執行moved的條件.
請問我該如果解決此問題呢
謝謝您