Storyboard problem - how to add objects to scene view group OUTSIDE of scene:enterScene function

I’m having a big problem using Storyboard in an actual game context where some display objects need to be created outside of the scene:enterScene function.

I can create objects inside the scene:enterScene function fine and they are removed fine when the scene changes. But for my game, like pretty much all games, I need to create and change display objects outside of the scene:enterScene based on logic that is dependent on specific gameplay events. However, when I try to add new display objects outside of the scene:enterScene function, I am unable to add them to the scene “group” created in scene:enterScene even if I use the group:insert function.

This is basic, fundamental functionality but I can’t find documentation on it anywhere in the Storyboard API or the FAQ or other explanatory posts. I know that Corona staff couldn’t have designed this so that all display objects had to be created inside the scene:enterScene function, right? That seems like it would just be inconsistent with any kind of complex game.

Please help. [import]uid: 76002 topic_id: 23257 reply_id: 323257[/import]

Consider the setup of any given storyboard scene:

local scene = storyboard.newScene()  
  
function scene:enterScene( event )  
 local group = self.view  
end  

Outside the enterScene function, the group is scene.view, so

scene.view:insert(obj)  

Should work fine.

However, it’s bad form to create display objects outside the scene events unless you’re very disciplined about how you manage your scenes re: purge and remove. [import]uid: 44647 topic_id: 23257 reply_id: 93087[/import]