Chapter 7. HTML in AIR

 

This chapter covers

  • Loading and displaying HTML
  • Controlling the loading of HTML
  • Referencing JavaScript objects from ActionScript
  • Referencing ActionScript from JavaScript

Normally, we try to temper our enthusiasm for a particular AIR feature with calm reason. But in the case of HTML in AIR, the feature is just too darn cool for us to bottle up all our excitement. In this chapter, we’ll share with you what we know about working with HTML in AIR, and once you’ve reviewed the facts for yourself, we think you’ll share our enthusiasm.

As a Flash or Flex developer, you’ve undoubtedly placed many an .swf file in an HTML page. Wouldn’t it be neat if you could do the inverse: render HTML inside a Flash or Flex application? Using AIR, you can do exactly that, because AIR includes the WebKit (www.webkit.org) web browser engine, the same engine that drives the popular cross-platform browser, Safari. The WebKit engine allows AIR applications to render HTML and execute JavaScript almost exactly as it would in a standard web browser. But what makes this feature even better is that, when the HTML is rendered in the AIR application, it is not only interactive, as HTML in a browser would be, but is also treated as a display object in the AIR application. That means you can do all the things you can do with a display object, including scaling, rotating, blurring, masking, and so forth.

7.1. Displaying HTML in AIR

 
 
 

7.2. Controlling how AIR loads HTML

 
 

7.3. Scrolling HTML content

 
 

7.4. Navigating HTML history

 
 
 
 

7.5. Interacting with JavaScript

 
 
 

7.6. Managing security issues

 
 
 

7.7. Adding HTML to AirTube

 
 
 

7.8. Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest