AIR for iOS makes it possible to display web pages to the user. For many situations, the simplest solution is to launch Safari (the device's native web browser) from your app. Many applications take this approach and once the user is finished with the page, they can move back to their app using the app switcher.
Let us see how to load a web page into Safari from an AIR for iOS app.
From the book's accompanying code bundle, open chapter11\recipe1\recipe.fla
into Flash Professional and use it as a starting point.
Sitting on the stage is a movie clip with an instance name of twitterBtn
. The movie clip's library symbol is linked to a class named Button
, which was introduced in the Handling user interaction recipe from Chapter 4.
Let us write some ActionScript to load www.twitter.com into Safari when the button is pressed.