Storyboard API: destroyScene() vs purgeScene()

Quick question, if we are unloading the entire scene in the destroyScene() event, why do we need to call purgeScene() in the next scene?

Additionally, what if a scene can be navigated to from more than 1 other scene, how then will we know which scene to purge? For example, sceneA can be loaded from both sceneB and sceneC. When sceneA loads, how do we know whether to purge sceneB or sceneC? [import]uid: 159810 topic_id: 33797 reply_id: 333797[/import]

The destroyScene event is for what you’d like to do when the scene is being disposed of (Corona will of course get rid of the display group for you)

Scenes will not be “destroyed” unless you either do it yourself or you are low on memory (in which case Corona will do this for you).

Think of it this way, calling purgeScene would trigger the destroyScene event for the scene it is being called on.

As for your other question, I believe you can list all scenes you’d like to get rid of. If they aren’t there, they’ll be ignored. [import]uid: 36054 topic_id: 33797 reply_id: 134338[/import]

There is also an API call to get the previous scene to purge it.

[import]uid: 199310 topic_id: 33797 reply_id: 134407[/import]

The destroyScene event is for what you’d like to do when the scene is being disposed of (Corona will of course get rid of the display group for you)

Scenes will not be “destroyed” unless you either do it yourself or you are low on memory (in which case Corona will do this for you).

Think of it this way, calling purgeScene would trigger the destroyScene event for the scene it is being called on.

As for your other question, I believe you can list all scenes you’d like to get rid of. If they aren’t there, they’ll be ignored. [import]uid: 36054 topic_id: 33797 reply_id: 134338[/import]

Right, this all makes much more sense now…this Storyboard API is great.

Thanks for the help! [import]uid: 159810 topic_id: 33797 reply_id: 134585[/import]

There is also an API call to get the previous scene to purge it.

[import]uid: 199310 topic_id: 33797 reply_id: 134407[/import]

Right, this all makes much more sense now…this Storyboard API is great.

Thanks for the help! [import]uid: 159810 topic_id: 33797 reply_id: 134585[/import]