Storyboard won't change scene until I click on the simulator, and never in an android build

I have a pretty weird problem.

 I have a function that tells the app to change scenes at a certain time.  But it won’t change scenes unless I actually click on the simulator.  I know it’s registering something because when it won’t change scenes when I click on the simulator before the scene change event occurs, but it will change afterwards.  I compiled for an android device, and it didn’t work then.  I’m at a loss for what to do.  Any help would be appreciated.

You likely have an error somewhere.  In particular if the device doesn’t do anything.  We really can’t help you very much with out seeing some of the relevant code and seeing’ what’s going on under the hood.  I suggest, reading this tutorial to figure out what’s going on:

http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Rob

After reading the documentation more thoroughly, I learned that Corona does not actually remove anything from the scene.  It must all be done manually.  The second scene was there, but just hidden by the background of the one before.

I hope that helps anybody with the same problem.

Hi @hdtruelson,

When you change scenes, display objects that were inserted into the scene’s view will be removed… but objects that you didn’t insert will not. So, there is a built-in auto-removal method of display objects, as long as you carefully manage which of these are actually part of the scene’s view.

Best regards,

Brent

Just to clarify this a bit more.  When you say “remove”, it has two meanings.

  1. get it off the screen so the next scene will show properly

  2. get rid of the objects from memory completely because I’m done with them.

Composer (and previously Storyboard) do both of these.  For the first one, yes, this is basically hiding the one scene and exposing the other.  Things in the scene’s view group will be transitioned off screen for the scene that’s going away and the new scene will be shown with the items in that scene’s view group.  In the case of a fade or crossFade (and a few other transition options), the new scene will simply be drawn on top of the old scene.  This is by design.

Now we don’t “remove” them from memory (in storyboard terms “Purge”) because we assume you want to go back to that scene at some point and it’s more efficient to use up some memory than it is to construct the scene from scratch every time.  So not “removing” the items from memory is a desired feature.   We do have API calls like storyboard.purgeScene() and storyboard.removeScene() (or for Composer, just composer.removeScene()) that will take any objects in the scene being removed from memory and it removes those objects for you.  But you do have to put them in the scene’s view group to be managed.

Rob

Thanks for the clarification on the purpose and architecture of the technology, Rob.  I found that the issue I was having was because I didn’t insert the objects into the scenes view group.  Once I put them in there, it fixed it up how it was supposed to.

You likely have an error somewhere.  In particular if the device doesn’t do anything.  We really can’t help you very much with out seeing some of the relevant code and seeing’ what’s going on under the hood.  I suggest, reading this tutorial to figure out what’s going on:

http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Rob

After reading the documentation more thoroughly, I learned that Corona does not actually remove anything from the scene.  It must all be done manually.  The second scene was there, but just hidden by the background of the one before.

I hope that helps anybody with the same problem.

Hi @hdtruelson,

When you change scenes, display objects that were inserted into the scene’s view will be removed… but objects that you didn’t insert will not. So, there is a built-in auto-removal method of display objects, as long as you carefully manage which of these are actually part of the scene’s view.

Best regards,

Brent

Just to clarify this a bit more.  When you say “remove”, it has two meanings.

  1. get it off the screen so the next scene will show properly

  2. get rid of the objects from memory completely because I’m done with them.

Composer (and previously Storyboard) do both of these.  For the first one, yes, this is basically hiding the one scene and exposing the other.  Things in the scene’s view group will be transitioned off screen for the scene that’s going away and the new scene will be shown with the items in that scene’s view group.  In the case of a fade or crossFade (and a few other transition options), the new scene will simply be drawn on top of the old scene.  This is by design.

Now we don’t “remove” them from memory (in storyboard terms “Purge”) because we assume you want to go back to that scene at some point and it’s more efficient to use up some memory than it is to construct the scene from scratch every time.  So not “removing” the items from memory is a desired feature.   We do have API calls like storyboard.purgeScene() and storyboard.removeScene() (or for Composer, just composer.removeScene()) that will take any objects in the scene being removed from memory and it removes those objects for you.  But you do have to put them in the scene’s view group to be managed.

Rob

Thanks for the clarification on the purpose and architecture of the technology, Rob.  I found that the issue I was having was because I didn’t insert the objects into the scenes view group.  Once I put them in there, it fixed it up how it was supposed to.