@tbaker0000
You can do 2 things to not crash using Director. The first thing will be native at the version 1.2.
1 - Boolean control: just put a test at the changeScene method to prevent executing again while transitioning, something like this:
if isChangingScene then
return
else
isChangingScene = true
end
And at the end of fxEnded function use this:
isChangingScene = false
2 - Always remember to test the phase of the event.
Wrong:
local function buttonTouched ( event )
director:changeScene("screenN","fade")
end
Correct:
local function buttonTouched ( event )
if event.phase == "ended" then
director:changeScene("screenN","fade")
end
end
If you are using UI.lua to create buttons then the phase is “release”
@NayGames
Congratulations for your game! It’s wonderful to see a Corona-made game been the top free at the AppStore and I’m really proud to know that you used Director on it! [import]uid: 8556 topic_id: 5264 reply_id: 17465[/import]