Load a webpage in Adobe AIR

By | March 2, 2011

This example shows how to load a webpage inside Adobe AIR,
For this first you have to place an HTML control in your design for loading the html content.
Create an page “index.html” inside the application directory of your current project and add some Html content to it.
After that copy the following code to your source file.

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()">
<mx:Script>
<![CDATA[
      private function init():void
      {
         this.stage.nativeWindow.maximize();    // maximizes your window.
         html.location="index.html";            // loads the html content in the html text area.
      }
]]>
</mx:Script>
<mx:HTML id="html"     width="100%" height="100%" />
</mx:WindowedApplication>

Please leave your comments on this post…….

Leave a Reply

Your email address will not be published. Required fields are marked *