Problem - storyboard.purgeScene / storyboard.removeScene

I am heaving an issue with the storyboard API.

I go from Screen(A) to Screen(B)
I call - storyboard.purgeScene(storyboard.getPrevious())

Screen(B) runs flawlessly

I go back to Screen(A)
I call - storyboard.purgeScene(storyboard.getPrevious())

Now I go back to Screen(B)

I start receiving errors in Screen(B) that I do not get the first time I navigate to it.
It’s like the Scene was not completely removed and unloaded so its not going back to the create.

I have also tried removeScene and I get the same error
storyboard.removeScene(storyboard.getPrevious())

Is this an error or am I doing something wrong?

Larry [import]uid: 11860 topic_id: 28325 reply_id: 328325[/import]

Hey, Larry @doubleslashdesign, I had a similar thing happen before, and it boiled down to the way I generated display.newGroup. I had a display group variable defined outside the createScene function, like so:

-- outside the createScene function where I forward declare variables  
local myGroup = display.newGroup()  

The problem was, I had all the display objects created and inserted to myGroup in createScene.

As soon as I changed it to look more like the following, the problem went away:

-- outside the createScene function where I forward declare variables  
local myGroup  
  
-- inside the createScene function  
myGroup = display.newGroup()  

I’m not sure if the cause of your problem is the same as mine, but just for in case, I thought I’d share my experience. I hope you’ll solve yours soon.

Naomi [import]uid: 67217 topic_id: 28325 reply_id: 114484[/import]

I know I am using 2 small display groups created outside of the scenes.

I’ll look at that to make sure that I clean them up in the destroy.

I was under the impression that as long as you added the item to the “scene display group” that it got cleaned up in the destroy automatically.

But I could be wrong.

Larry [import]uid: 11860 topic_id: 28325 reply_id: 114498[/import]