Pressing the home button on iOS 3 devices closes the current app and removes it from memory. Performing the same action on a device running iOS 4 or above places the app in a suspended or background state rather than closing it. However, a user can close and remove these apps from memory using the fast app switcher. Additionally, when system memory is low, iOS itself may decide to close suspended or background apps.
If the user decides to close your app then, just before it exits, you will be given an opportunity to perform any house keeping, such as saving state or freeing memory.
We will add some more code to the current version of your Bubbles app, allowing it to gracefully exit. Alternatively, from the book's accompanying code bundle, open chapter3\recipe4\bubbles.fla
and work from there.