I added a
print(“does this happen” )
line to the “did” phase, but it doesn’t trigger when I switch scenes. Not the most advanced code I know, but it should trigger shouldn’t it?
If I add the print to the will phase it does trigger.
[lua]
function scene:hide( event )
local sceneGroup = self.view
local phase = event.phase
if ( phase == “will” ) then
– Called when the scene is on screen (but is about to go off screen).
– Insert code here to “pause” the scene.
– Example: stop timers, stop animation, stop audio, etc.
elseif ( phase == “did” ) then
– Called immediately after scene goes off screen.
print(“does this happen” )
end
end
[/lua]