[lua]
local function stopWhateverThisButtonMakesYouDoing()
print(“no more pew pew pew”)
end
local function buttontouch(event)
if ( event.phase == “began” )then
display.getCurrentStage():setFocus( event.target )
event.target.isFocus = true
event.target.movedOutside = false
event.target.boundLeft = event.target.x - (event.target.width*0.5)
event.target.boundRight = event.target.x + (event.target.width*0.5)
event.target.boundTop = event.target.y - (event.target.height*0.5)
event.target.boundBottom = event.target.y + (event.target.height*0.5)
end
if ( event.phase == “moved” and not event.target.movedOutside)then
if(event.x >= event.target.boundRight or event.x <= event.target.boundLeft or event.y <= event.target.boundTop or event.y >= event.target.boundBottom)then
print(“moved outside”)
display.getCurrentStage():setFocus( nil ) – clear touch focus
event.target.focus = false
event.target.movedOutside = true
stopWhateverThisButtonMakesYouDoing()
--event.phase = “cancelled”
end
end
if ( event.phase == “ended” and not event.target.movedOutside)then
print(“ended”)
display.getCurrentStage():setFocus( nil ) – clear touch focus
event.target.focus = false
stopWhateverThisButtonMakesYouDoing()
end
end
button_fw:addEventListener( “touch”, buttontouch)
[/lua]
i always was asking myself if there isnt any easier solution than this workaround, so if anyone knows it please reply.