Director class : MAJOR BUG!

If you click on a button that’s on a screen being changed from bfore the screen has fully transitioned it causes the next screen to be transitioned to again. This causes a crash on the device.

Ricardo (or anyone) how can this be fixed? TA! [import]uid: 9371 topic_id: 4925 reply_id: 304925[/import]

add/remove the touch event listeners from the buttons after the transition? there’s a transition complete event presumably?

[import]uid: 6645 topic_id: 4925 reply_id: 15971[/import]

No that won’t help as the problem is caused because the listeners are still active DURING the transition.

I think i need to remove them BEFORE the transition call. [import]uid: 9371 topic_id: 4925 reply_id: 15982[/import]

Do you get an error like this: (Segmentation or Bus error!)

Copyright © 2009-2010 A n s c a , I n c .
Version: 2.0.0
Build: 2010.243
The file sandbox for this project is located at the following folder:
(/Users/derwydd/Library/Application Support/Corona Simulator/game4-60DFA3011116F87540F7FEE1BC2D16E2)
/Applications/Corona.243/Corona Terminal: line 9: 528 Segmentation fault “$path/Corona Simulator.app/Contents/MacOS/Corona Simulator” $*
logout
[import]uid: 7197 topic_id: 4925 reply_id: 16289[/import]

Don’t know as I fixed it by clearing the touch listeners prior to the director change scene call [import]uid: 9371 topic_id: 4925 reply_id: 16290[/import]

Yep, I have no touch Listeners on this screen!
I have timers and eventListeners.

I removed all eventListeners to see if that was the cause, and it is not!

/Applications/Corona.243/Corona Terminal: line 9: 2214 Bus error "$path/Corona Simulator.app/Contents/MacOS/Corona Simulator" $\* logout [Process completed] [import]uid: 7197 topic_id: 4925 reply_id: 16292[/import]

Are we suppose to be removing or stopping timers and EventListeners manually? [import]uid: 7197 topic_id: 4925 reply_id: 16295[/import]

Solved:
The button handler was causing the issue. I went through and commented everything out. Last of course was the button handler. I switched it over to Ricardo’s button example, and that did it.

This does not work:

 local btnPlay = ui.newButton{  
 default = "images/play.png",  
 over = "images/play.png",  
 onEvent = playHandler,  
 id = "playBtn",  
 text = "",  
 size = 12,  
 emboss=true  
 }  

This works:

local bt02 = display.newImage("images/play.png") local function bt02t ( event ) if event.phase == "ended" then media.stopSound() director:changeScene("playerSelection","moveFromRight") end end bt02:addEventListener("touch",bt02t) bt02.x = 240 bt02.y = 80 localGroup:insert(bt02) [import]uid: 7197 topic_id: 4925 reply_id: 16308[/import]

Guys, please write your questions at Director’s sub-forum. I don’t have too much time to answer and I really didn’t see most of the topics created for Director. I’m sorry for that and I will appreciate if you all could go to this link:

http://developer.anscamobile.com/forums/director-class [import]uid: 8556 topic_id: 4925 reply_id: 18688[/import]

I am too getting “367 Segmentation Fault” in my app and my app is crashing.Is this a Director Problem? I am just not able to understand the problem that I am facing. Can anybody help me?
Thanks in advance… [import]uid: 82446 topic_id: 4925 reply_id: 56035[/import]

I just traced the issue back to ui.lua, not sure to have the solution other than:
don’t use ui.lua buttons to switch between scenes, either director or storyboard.
or even better, don’t use ui.lua buttons AT ALL.
see more info at:
http://developer.anscamobile.com/forum/2011/01/12/segmentation-or-bus-error#comment-107273
[import]uid: 80100 topic_id: 4925 reply_id: 107279[/import]