O'Reilly logo

Professional Adobe® Flex® 3 by Joe Berkovitz, David Hassoun, Andrew Trice, Tom Sugden, Todd Prekaski, Jun Heider, Peter Ent, Joseph Balderson

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 39. HTML Mashups with AIR

Adobe AIR includes functionality to render HTML content in a native application. Unlike traditional Flex applications running in the web browser that require IFrame HTML hacks to overlay rendered HTML in an application, Adobe AIR leverages its WebKit web browser engine for rendering any HTML content, including CSS and JavaScript, inside an AIR application.

Using the Flex mx:HTML tag, both remote and local HTML content can be rendered in an AIR application. Additionally, bidirectional interaction between ActionScript and JavaScript, including HTML DOM manipulation, is available to the developer.

Why Embed HTML in an AIR Application?

With traditional Flex applications running inside a web browser, the developer is limited to rendering HTML to a small subset of HTML tags supported by Flex's Label component through the htmlText property (<a>, <b>, <br>, <font>, <image>, and a few others). There are also workarounds in Flex applications for overlaying an HTML IFrame (provided by the host web browser) over a portion of the visible Flex application, which is crude, but often necessary for displaying complex HTML in an application. With Adobe AIR, these techniques are no longer necessary, as AIR provides a complete implementation of the WebKit web browser (complete with Squirrelfish JavaScript VM) in which any HTML and JavaScript can be rendered and executed (as long as security sandbox constraints are met — more later).

While complete AIR applications can ...

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