Displaying web pages in an HTML control in an Adobe AIR application
The following example shows how you can display web pages in an Adobe AIR HTML control by setting the location
property.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?> <!-- http://airexamples.com/2009/01/03/displaying-web-pages-in-an-html-control-in-an-adobe-air-application/ --> <mx:WindowedApplication name="HTML_location_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" width="1024" height="768"> <mx:Script> <![CDATA[ private function btn_click(evt:Event):void { html.location = textInput.text; } ]]> </mx:Script> <mx:ApplicationControlBar dock="true"> <mx:Form styleName="plain" defaultButton="{btn}" width="100%"> <mx:FormItem label="location:" direction="horizontal" width="100%"> <mx:TextInput id="textInput" text="http://airexamples.com/" width="100%" /> <mx:Button id="btn" label="Go" click="btn_click(event);" /> </mx:FormItem> </mx:Form> </mx:ApplicationControlBar> <mx:HTML id="html" width="100%" height="100%" /> </mx:WindowedApplication>
- Share this:
4 Responses to Displaying web pages in an HTML control in an Adobe AIR application
Leave a Reply Cancel reply
- http://get.adobe.com/air/
- Platform ActionScript Language Reference
Recent Posts
- Detecting the number of screens on a users system in Adobe AIR
- Opening a new NativeWindow in Adobe AIR
- Detecting the line-ending character sequence used by the host operating system in Adobe AIR
- Displaying a custom title bar icon in a WindowedApplication container in Adobe AIR
- Setting a custom text style on the status bar on a WindowedApplication container in Adobe AIR
- Keeping a WindowedApplication on top of other windows in Adobe AIR
- Specifying whether a new Window is focused in Adobe AIR
- Opening a new Window in Adobe AIR
- Setting the file size display mode in the Flex FileSystemDataGrid control in Adobe AIR
- Sorting the FileSystemDataGrid control by date in Adobe AIR
Archives
- March 2010 (10)
- February 2009 (3)
- January 2009 (6)
- December 2008 (44)
Hi Peter,
Thanks a ton for this example.
I am new to AIR technology.
I was looking to acheive this for long time.
Can you guide me on two scenario?
Scenario 1:
I am developing an Air Project, wich will run on a corporate LAN.
I want user to first login on corporate website before using air project.
I am thinking of two options:
a) When user open air project ask user to click on a button to login on corporate site, when user click the button launch the corporate site’s login page and close the air application after login user will be taken to a web page which will say click here to launch air application, there i can pass the user session info as arguments to the air application while launching.
b) I open the corporate site’s login page inside air application using above logic, but in that case, after user logs in what best can i do to close the web page and pass on the session info to air application?
Scenario 2:
As in flex project we can create multiple applications (multiple swf files) and switch from one application to another using navigateToURL. How can we switch from one swf to another in an air project?
Thanks & Regards,
Gurpreet Singh
Hello,
Why AIR application is failing when I try to connect to https website.
how could i get Air to print out the html in the Html control?
Hi Peter,
I am new in This technology.
Is it possible that I Open my gmail account through HTML control of Adobe Air?
If I enter my email address and password in 2 textboxes and than click on a button, It automatic redirect to my gmail account.
Is this possible?
Thanks in advance.
Anand Meena