Book Image

Flash iOS Apps Cookbook

By : Christopher Caleb
Book Image

Flash iOS Apps Cookbook

By: Christopher Caleb

Overview of this book

The latest version of Flash Professional can directly target iOS, allowing Flash developers to write applications that will run natively on Apple's iPhone, iPad, and iPod touch. What's more, with Apple loosening its restrictions on third-party technologies, apps written in Flash can now be sold and distributed within the App Store.Flash iOS Apps Cookbook provides the recipes required to build native iOS apps using your existing knowledge of the Flash platform. Whether you want to create something new or simply convert an existing Flash project, the relevant steps and techniques will be covered, helping you achieve your goal.Learn how to configure and use Flash Professional for iOS development by writing and deploying a simple app to a device. Implement many iOS-specific features such a multi-touch, the virtual keyboard, camera support, screen orientation and the Retina display. Overcome the limitations of mobile development by mastering hardware acceleration and optimization. Whether you're an enthusiast or professional developer, the Flash iOS Apps Cookbook is your toolkit to creating high-quality content for iPhone, iPad and iPod touch.
Table of Contents (21 chapters)
Flash iOS Apps Cookbook
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Exiting gracefully from an app


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.

Getting ready

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.

How to do it...

Let us listen for and handle the Bubbles app being closed:

  1. Open Main.as within Flash Professional.

  2. We will make use of the Event class. Ensure...