I am not sure if this is what your looking for but, as i remember it… Its up to YOU to clean up any timers and transitions you start in a “scene”.
When you do a Director change scene event, Director launches the new scene, but as soon as it starts the new scene Director calls a CLEAN function from the LAST scene it just left, which can be used to clean up any timers / listeners you need to stop. The function must always be named “clean”
I put this function at the bottom of every one of my scenes with director. Also note, you dont have to do anything to CALL this function. Director automatically calls it for you. As long as your scene has one and its named exactly this.
[lua] --************************************************************************
–***** Change Scenes Clean Up
–************************************************************************
function clean (event)
–print (“Clean Play Game”)
–Particles.CleanUp() – This Cleans up ALL PARTICAL CANDY ITEMS
–Runtime:removeEventListener( “enterFrame”, heartBeat )
if timer1 then timer.cancel(timer1) end
if timer2 then timer.cancel(timer2) end
if timer3 then timer.cancel(timer3) end
if timer4 then timer.cancel(timer4) end
if gravityShift then timer.cancel(gravityShift) end
end
–********** END of non Direcotr CODE ***********************
return localGroup – Director - MUST return a display.newGroup()
end – Director Function end[/lua] [import]uid: 88147 topic_id: 27451 reply_id: 126187[/import]