I use storyboard.
In one scene there is a scene group:
group = self.view
And an another display group:
pathGroup = display.newGroup()
I insert the pathGroup into scene group:
group:insert(pathGroup)
Everything works fine first time, but when I enter the scene again , I’ll get an error in every sentence like this:
pathGroup:insert(nuolianimaatio)
Error message is following:
attempt to call method 'insert' (a nil value)
In the exitScene function I nil the groups:
for i=pathGroup.numChildren,1,-1 do local child = pathGroup[i] child.parent:remove( pathGroup ) child=nil end for i=group.numChildren,1,-1 do local child = group[i] child.parent:remove( group ) child=nil end
I’m probably missing something. Thanks in advance!
Then I took the removeScenes away, 'cause I thought it would be better because scenes are revisited often, and got the error.