group = self.view throwing error after 3rd or so time around

Hello all,

I have a multiscene project.  It works just as it should changing scenes from intro to game to end scene and back to intro again.  But after about three cycles, I get this inexplicable error “attemp to index local group, a nil value”.  Does anyone have any idea why this is occuring and what I can do to fix it?  Here’s where the group I created is.

function scene:enterScene( event )

local group = self.view

I also have this code in the same file

function scene:didExitScene( event )

        local group = self.view

storyboard.purgeScene(‘gamescene’);

Runtime:removeEventListener(‘enterFrame’, frameUpdate);

all help appreciated!

Are you trying to purge the scene that’s showing some where?  Could you have made the “scene” object global?

Rob

Found A workaround:

I don’t know why this worked, but I removed the purgeScene part and put storyboard.purgeAll() at the beginning of the willEnterScene of the next scene I wanted to load.  In response to your question though, I was trying to purge the scene that just was shown.  This seems like kind of a weird error so I still wonder what I am doing wrong.

Are you trying to purge the scene that’s showing some where?  Could you have made the “scene” object global?

Rob

Found A workaround:

I don’t know why this worked, but I removed the purgeScene part and put storyboard.purgeAll() at the beginning of the willEnterScene of the next scene I wanted to load.  In response to your question though, I was trying to purge the scene that just was shown.  This seems like kind of a weird error so I still wonder what I am doing wrong.