Chapter 3. Using HTML Within Flex-Based Apollo Applications

Apollo gives developers a brand new way to integrate HTML rendering into desktop applications. Apollo’s new HTML functionality includes the ability to:

  • Load and render complete web pages (HTML and XHTML) from local and remote URLs as well as a string.

  • Access and manipulate the full Document Object Model (DOM).

  • Call JavaScript functions and reference JavaScript objects from within your ActionScript code, and vice versa.

  • Arrange the Flex HTML component in your application interface as you would any other Flex UI component.

  • Graphically alter the HTMLControl object or Flex HTML component as you would any Sprite or DisplayObject in ActionScript.

The new flash.html.HTMLControl class handles the core HTML loading, rendering, and script execution duties. Based on the HTMLControl class, the new Flex HTML component integrates the same HTML rendering power into the Flex UI framework.

An application with simple HTML rendering or web browsing needs can use the Flex HTML component with little or no ActionScript coding. Of course, more complex requirements will call for additional coding in either ActionScript or JavaScript.

This chapter describes Apollo’s HTML capabilities and offers a number of quick examples to get you started writing HTML-enabled Apollo applications.

You can also refer to the "Working with HTML" section of Chapter 5 for more ways to use HTML in Apollo.

HTML Support in Apollo

The Apollo HTMLControl class uses WebKit (www.webkit.org ...

Get Apollo for Adobe Flex Developers Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.