how can i clear all object when i switch to other screen

i’m using the storyboard, how can i clear all objects when i switch to other screen. want to ensure clearing all objects. [import]uid: 22631 topic_id: 21726 reply_id: 321726[/import]

I haven’t experimented with store board that much, but I assume you add everything to a group. I would recommend using Director.

Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 21726 reply_id: 86264[/import]

If you look at the storyboard example in CoronaSDK > SampleCode > Interface you will see how groups work in Storyboard - which is to insert objects into screenGroup :slight_smile:

Peach [import]uid: 52491 topic_id: 21726 reply_id: 86279[/import]

as stated, add every display object to the scene group:

bgimage1 = bgSprites:grabSprite("bg1", true)  
screenGroup:insert(bgimage1)  

when leaving the screen, purge the old scene by adding this line inside the enterScene event of the new scene:

storyboard.purgeScene("oldScene")   

-finefin [import]uid: 70635 topic_id: 21726 reply_id: 86287[/import]

One hint, stay away from storyboard for now, it has some bugs and it is better to use the director class.

Joakim [import]uid: 81188 topic_id: 21726 reply_id: 86357[/import]

Joakim, what bugs do you mean? I’m using this api quite successfully… [import]uid: 70635 topic_id: 21726 reply_id: 86370[/import]

Theres a know bug with a time delay between screen transitions, and some others here in the forum. The time delay made me to switch from Storyboard to Director.

Joakim [import]uid: 81188 topic_id: 21726 reply_id: 86373[/import]

Funny that. I’m getting a time delay as well…I am using story board. Any confirmed fixes for the delay? It makes the entire app feel somewhat sluggish. [import]uid: 42417 topic_id: 21726 reply_id: 87413[/import]