Double Click Crash

I noticed that if you try to double click using the latest director (sample), it crashes. I noticed that bubble ball uses transitions and it crashes as well (although it may not use director). Is there a fix for this?

Thanks! [import]uid: 7587 topic_id: 5264 reply_id: 305264[/import]

@tbaker0000, I think the doubleclicking on a button (I assume you were double-clicking on a button), is a UI.lua bug, although Bubble Ball does use Director. It seems I saw a fix for this floating around the forums, but didn’t think much of it at that time… [import]uid: 8782 topic_id: 5264 reply_id: 17423[/import]

Thanks Robert, I’ll look in that direction. I’ll let you know what I rummage up - unless you beat me to it :slight_smile: [import]uid: 7587 topic_id: 5264 reply_id: 17426[/import]

@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]

Excellent, thank you Ricardo. [import]uid: 7587 topic_id: 5264 reply_id: 17501[/import]

Thanks, Ricardo! Look forward to the new release with that bug fix. (I had been meaning to send you an email before Bubble Ball was released saying thanks, etc. for Director, but it never happened…)
Anyways, thanks for an awesome tool! [import]uid: 8782 topic_id: 5264 reply_id: 17645[/import]