In addition to remote web pages, it is also possible to load and display local HTML files using the StageWebView
class.
Let us bundle a web page with your application and load it at runtime.
This recipe requires Flash Professional CS5.5 and AIR 2.6 or above.
From the book's accompanying code bundle, open chapter11\recipe4\recipe.fla
and use it as a starting point.
Sitting in the same location as the FLA is a folder named html
, which contains the HTML page that has to be loaded by your app. Using Windows Explorer or Finder, take a look at the folder's contents. Also in the index.html
file, you will find a PNG image and a style sheet, which are both used by the HTML.