Basic web browser using Adobe Air

To illustrate my design concepts I will be using the Adobe AIR platform

“The Adobe® AIR™ run-time lets developers use web technologies to build rich Internet applications that run outside the browser on multiple operating systems.”  It’s just strange that I will be building a browser inside :)

A web browser using Adobe AIR by Amr M. Kamel

http://amrkamel.wordpress.com/2008/03/09/web-browser-using-adobe-air/

Code from the above link -  weird quotation marks that wont work in Flex appear sadly ( also removed an error encountered in Flex 3 for using a button labels ‘<’ and ‘>’  )

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
title="ShiftBrowse">
<mx:Script>
<![CDATA[
private function onClick(event:Event):void {
if(event.currentTarget == urlButton){
myHTML.location = urlTextInput.text;
} else if(event.currentTarget == backButton){
myHTML.historyBack();
} else if(event.currentTarget == forwardButton){
myHTML.historyForward();
} else {
//DO NOTHING!!!
}
}
]]>
</mx:Script>
<mx:ApplicationControlBar width=”100%”>
<mx:VBox width=”100%”>
<mx:HBox width=”100%”>
<mx:Button id=”backButton” label=”back” fontWeight=”bold”
click=”onClick(event)”/>
<mx:Button id=”forwardButton” label=”forward” fontWeight=”bold”
click=”onClick(event)”/>
<mx:Label text=”URL:” fontWeight=”bold”/>
<mx:TextInput id=”urlTextInput” text=”{myHTML.location}” width=”235″/>
<mx:Button id=”urlButton” label=”OK”
click=”onClick(event)”/>
</mx:HBox>
</mx:VBox>
</mx:ApplicationControlBar>
<mx:HTML id=”myHTML” width=”100%” height=”100%”
location=”http://google.com”/>
</mx:WindowedApplication>

Leave a Reply