O'Reilly logo

Adobe AIR 1.5 Cookbook by Koen De Weggheleire, Koen DeWeggheleire, Marco Casario, David Tucker, Rich Tretola

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. HTML Content

Adobe AIR allows a strong integration with HTML content and JavaScript. Thanks to the WebKit open source browser engine embedded in the Adobe runtime, AIR offers a complete and robust HTML renderer and JavaScript interpreter to re-create a browser-like experience. Through the WebKit framework (http://webkit.org/), developers can create an AIR application completely in HTML, JavaScript, DOM, and CSS. In AIR 1.5, the new SquirrelFish JavaScript interpreter from the WebKit project was added. This makes JavaScript code execution extremely fast within AIR.

The core of the HTML and JavaScript environment is represented by the HTMLLoader class, which enables you to specify the HTML content to display in an AIR application. HTMLLoader is part of the flash.html package and is a subclass of the Sprite class that does not implement the UIComponent interface. If you want to use the class in AIR applications created with Flex, you have to extend the UIComponent interface and include an HTMLLoader object.

The HTMLLoader object can also be accessed via JavaScript by using the htmlLoader property of the window object. In HTML windows, the HTMLLoader object contains all the HTML content that is, in turn, contained in a NativeWindow object. Furthermore, the HTMLLoader object provides properties, methods, and events to control how content is loaded and rendered within the AIR application.

When you use HTML content in an application, you need to understand how to interact with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required