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

Rendering a web page within an app


Since AIR 2.6, it has been possible to load and display HTML content directly within an AIR for iOS app. This is convenient as it prevents the user from having to leave the app to view web pages. It also provides other benefits such as tighter OAuth (Open Authorization) integration, and the ability to include HTML banner ads.

This recipe will show you how to load a remote web page directly into your app.

Getting ready

The steps covered here are only applicable to those using Flash Professional CS5.5 and AIR 2.6 or above. The AIR 2.0 SDK does not provide an API for loading HTML within an app.

From the book's accompanying code bundle, open chapter11\recipe2\recipe.fla into Flash Professional CS5.5. The FLA's stage is empty but its AIR for iOS settings have already been applied, saving you the effort when it comes to publishing it.

How to do it...

We will be taking advantage of the StageWebView class to render a web page.

  1. Create a document class and name it Main...