Storyboard and ExitScene Question

Hey guys quick question…

I have a function called Clean which i use to clean up display objects, cancels timers, etc. I call this function in the scene:exitScene listener for the storyboard scene…

My question is this, when a user exits my application does storyboard call scene:exitScene listener or do I need to add the system event listener to listen for applicationExit to handle my Clean function?

Thanks in advanced! [import]uid: 141138 topic_id: 26319 reply_id: 326319[/import]

Great question!

Things that occur at the system level (such as user switching between apps, closing them, getting a phone call, etc) is NOT handled by Storyboard and should be handled via a system event listener (as you mentioned).

local function onSystemEvent( event ) if event.type == "applicationExit" then do_something() endendRuntime:addEventListener( "system", onSystemEvent )[/code]More info on the different types of system events here:http://developer.anscamobile.com/reference/index/eventtype-0 [import]uid: 52430 topic_id: 26319 reply_id: 106714[/import]

Hi Jonathan,

Thanks for taking the time to answer my question, it seems like I was doing the right thing by handling it all on my own but I also called it in exitScene just to be sure =P
I was just wanting to be sure that I wasnt doing any uneeded calls so now that I am sure I can safely remove them…

Thanks again, and IMO this should be mentioned on the storyboard page for anyone else that may be in the dark or unsure about it =P (if it already is i appologize)

Have a nice day and keep up the good work! [import]uid: 141138 topic_id: 26319 reply_id: 106795[/import]

BTW, you inspired the topic for this week’s tutorial, so you might find the information beneficial:

Handling Corona System Events

Thanks. [import]uid: 52430 topic_id: 26319 reply_id: 106938[/import]

Hi Jonathan,

Thanks a TON for the tutorial! I really enjoy these tutorials and without them I honestly can say I wouldnt be anywhere near where I am with my project…
Also thanks alot for helping out with quick, and informational answers, this truely is one of the main reasons I am planning on subscribing when I get the funds
I have never seen such a strong helpful community as Corona forums…

Thanks again and you are quite welcome for the inspiration, i feel honored =P

[import]uid: 141138 topic_id: 26319 reply_id: 107031[/import]