« Flex Compiler Resources | Main | Flash Job In Flashlog »

AIR Conversion of the IFrame Demo

I've converted the iframe demo found in the HTML in Flex post into an AIR demo. In this post is a badge to install the application, a link to the source, and a list of the differences between the two versions.

A badge to install and run the application is on this separate page until I can figure out how to get Movable Type to stop entitizing scripts. You can also view the source of the demo here.

The AIR HTML demo shows how easy it is to switch from using an iframe to mx:HTML. Of course, it may not be easy to convert some of the particulars of a large application or to convince your boss to use AIR, but the basic conversion only takes a few hours.

Here's what had to change from the iframe demo:

  • The IFrame component has been removed and is simply replaced with mx:HTML. The 'source' attribute changed to 'location'.
  • No HTML wrapper file is needed, since this is an AIR application. But an AIR badge, not included in these source files, is used to launch the AIR app from a web page. You can find the source to the badge that was used on Adobe Labs.
  • Application changed to WindowedApplication, as is needed for all AIR applications.
  • HTMLDemo-app.xml was added, the AIR configuration file.

A few more changes were made, additional enchancements that weren't needed for the AIR conversion:

  • Cleaned up the MXML, moving code into functions.
  • Used the HTML events to show a busy cursor when a page is loading.
  • Added back some sites that didn't work in the Flex version.
  • Added Wacky HTML mode for the fun of it, to show how easy it is to change the display of HTML in an AIR app.

In case you missed it earlier, note that you can install the application here.

While I've attended AIRCamp and read a good deal about AIR, this is the first thing I've ever compiled with AIR. So just let me know if I've done anything dumb.

TrackBack

Listed below are links to weblogs that reference AIR Conversion of the IFrame Demo:

» AIR 版的 IFrame from Dreamer's Blog
以前Adobe Flex刚出来的时候,很多人想要同时利用Flex 和 HTML,在Flex中嵌入HTML,所以当时不少牛人写出了Flex中的IFrame,其中Adobe的Deitte发布过一个适用于Adobe Flex 2的 IFrame版本,现在他将这个 IFrame改写为AIR版的,并将两个版本的区别列了出来。当然由于AIR本来就自带HTML引擎,所以用AIR做这种事情简单地很。 原文 Demo 查看源码 分享收藏 ... [Read More]

Comments (2)

Siva Kumar:

Hi,

Really its looking at good. But what I observed is we are unable to download files.... is there any way to down load files using mx:HTML. But if we use iframes its allowing to download files. Please revert me is there any way to download files using mx:HTML tag. It saves me a lot. Thanks in advance.

Thanks & Regards,
Siva Kumar

Hugo Miguel:

hi,

how can i get the parameters of an element in the loaded html DOM? for example get an element id.