Thx for the answer. But doing so kills my listener :
I do EXACTLY the same code on scene1.lua and scene2.lua :
-- outside of the composer listener functions local background local function backgroundTouch( self, event) -- standard touch fonction with composer.gotoScene( "scene2") -- of course, in scene2 I do composer.gotoScene( "scene1" ) end -- In scene:create background = display.newRect( 0, 0, width, height ) background.touch = backgroundTouch -- In scene:show (did) background:addEventListener( "touch", background ) -- In scene:hide (will) background:removeEventListener( "touch", background )
My problem : I start on scene1, go to scene2, but impossible to go back to scene1 (as if the background listener was removed)
Thx for the answer. But doing so kills my listener :
I do EXACTLY the same code on scene1.lua and scene2.lua :
-- outside of the composer listener functions local background local function backgroundTouch( self, event) -- standard touch fonction with composer.gotoScene( "scene2") -- of course, in scene2 I do composer.gotoScene( "scene1" ) end -- In scene:create background = display.newRect( 0, 0, width, height ) background.touch = backgroundTouch -- In scene:show (did) background:addEventListener( "touch", background ) -- In scene:hide (will) background:removeEventListener( "touch", background )
My problem : I start on scene1, go to scene2, but impossible to go back to scene1 (as if the background listener was removed)