I’m having a weird problem with touch events.
I have two scenes, with two different grids.
There are using onScreenTouch events for both scenes.
Somehow the touch event, even with Runtime:removeEventListener( “touch”, onScreenTouch ) in scene exit, is still detecting the touches on the other scene.
When I switch between the scenes, the touch events show that they are registering for both grids in both scenes. The display objects that have been triggered are properly removed by group:insert, but seem to be generated when I switch to the scene that contains them.
Does anyone know how I can fix this?
local function onScreenTouch( event )
if ( event.phase == began ) then
-- set variables and display objects
end
end
------
Runtime:addEventListener( "touch", onScreenTouch )
------
function scene:exitScene( event )
local group = self.view
physics.stop()
Runtime:removeEventListener( "touch", onScreenTouch )
end
[import]uid: 89362 topic_id: 36172 reply_id: 336172[/import]