How to debug issue where transition.to sometimes causes both screens to show?

Hi,

I have two files homescreen.lua and gamescreen.lua - I use transition.to to transition back and forth between these screens (No storyboard). I have (to the best of my knowledge) ensured that all display objects are under the main group for each screen (homeGroup and gameScreenGroup). 

Sometimes, but not always, I get a situation (on the iPhone, not in the simulator so far) where transitioning from home screen to game screen renders the game screen on top of the home screen. 

In the past, when this happened, this was fixed by finding some display object that was not added in the main group’s hierarchy. However, I am unable to find any such unaccounted display object. 

How do I go about debugging and fixing this?

Thanks

Anand

bump…

Hi Anand.  We are going to need to see some code before anyone can help you.  What you described should work unless you’ve got some interaction where your transitions are getting stomped on or whatever triggers them is triggering a transition you’re not expecting.

Thanks, Rob.

I debugged it some more and found the issue - it wasn’t related to the memory angle at all - turns out I was tapping the play button twice on the homescreen, which led to gamescreen being constructed twice. When game ended, only one gamescreen got released in the end transition, and that led to the overlap screen effect. To fix it, I made the button click to be idempotent using a flag, and the issue went away. 

Thanks,

Anand

bump…

Hi Anand.  We are going to need to see some code before anyone can help you.  What you described should work unless you’ve got some interaction where your transitions are getting stomped on or whatever triggers them is triggering a transition you’re not expecting.

Thanks, Rob.

I debugged it some more and found the issue - it wasn’t related to the memory angle at all - turns out I was tapping the play button twice on the homescreen, which led to gamescreen being constructed twice. When game ended, only one gamescreen got released in the end transition, and that led to the overlap screen effect. To fix it, I made the button click to be idempotent using a flag, and the issue went away. 

Thanks,

Anand