StoryBoard Simple Questions

Hi,

I have been playing with the StoryBoard API and it seems really great. I have done a bunch of searches and looked at a lot of samples. I am having a couple small issues that I just cant figure out. Maybe someone will be nice enough to help me here.

  1. I added a bunch of object to my scene from a function that is called from an event listener function goToNext() which is setup in scene:enterScene( event ).
function scene:enterScene( event )  
 local group = self.view   
 button\_next:addEventListener("touch", goToNext)  
end  

The thing is that I cant use screenGroup:insert() in the goToNext function… I get the “attempt to index global” error in the console.

So my question is, how can I add objects to the scenegroup from outside the scene: functions?

  1. If I do use screenGroup:insert() for all my elements, so I still need to use removeSelf() and =nil on them Or when I change/destroy scenes will all of that be taken care of automatically?

Thanks for your patience and help!
[import]uid: 112147 topic_id: 22344 reply_id: 322344[/import]

I don’t think you need to insert elements in the screengroup.
insert them in self.view instead (on the createScene) and storyboard should take care of things from there on… They’ll be removed if you purge/destroy the scene (can’t remember which).
Use the exitScene and destroyScene events for event handle removal. check http://blog.anscamobile.com/2011/11/common-storyboard-api-questions/#when-exactly-do-the-events-get-called to know when each event gets called [import]uid: 79152 topic_id: 22344 reply_id: 89061[/import]

How do I insert elements in self.view, I have not seen any code for that? I have only seen the screenGroup:insert() used in the examples. [import]uid: 112147 topic_id: 22344 reply_id: 89095[/import]

How can I change the scene when I click on the button? [import]uid: 162639 topic_id: 22344 reply_id: 119304[/import]