Return to Snippet

Revision: 36060
at November 17, 2010 12:07 by proto


Initial Code
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
						xmlns:s="library://ns.adobe.com/flex/spark" 
						xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute"
						title="BrowserApp" 
						showStatusBar="false" 
						backgroundColor="0x000000" backgroundAlpha="0.5" 
						applicationComplete="init()">
						
	<fx:Script>
		<![CDATA[
			<script type="text/javascript" src="AIRSourceViewer.js"></script>
			private function init():void 
			{
				stage.displayState=StageDisplayState.FULL_SCREEN_INTERACTIVE;
				stage.nativeWindow.title = title; 				
			}
			
			[Bindable]private var hisArr:Array = new Array(); 
			private function setHistory():void{ 
				hisArr = new Array(); 
				var len:int = myHTML.historyLength; 
				while( len -- ){ 
					hisArr[len] = myHTML.getHistoryAt(len); 
				} 
			} 
			
			
			private function onClick(event:Event):void {
				if(event.currentTarget == urlButton || (urlTextInput)){
					//if(urlTextInput.text.search("app:/")) {
							
					myHTML.location = urlTextInput.text.replace("app:/", "");
				
				} else if(event.currentTarget == backButton){
					myHTML.historyBack();
				} else if(event.currentTarget == forwardButton){
					myHTML.historyForward();
				} else if(event.currentTarget == refreshButton) {
					myHTML.reload();
				} else {
					//DO NOTHING!!!
				}
			}
		]]>
	</fx:Script>
	<mx:DataGrid id="dg" dataProvider="{hisArr}" width="125" height="100%" 
				 itemClick="{myHTML.historyPosition = dg.selectedIndex}" left="0"> 
		<mx:columns> 
			<mx:DataGridColumn headerText="Recent" dataField="title"/> 
			<mx:DataGridColumn headerText="URL" dataField="url" visible="false"/> 
		</mx:columns> 
	</mx:DataGrid> 
	<mx:ApplicationControlBar width="100%" dock="true" borderVisible="true" dropShadowVisible="false" x="0" y="0">
		<mx:VBox width="100%">
			<mx:HBox width="100%" borderVisible="true">
				<mx:Button id="backButton" label="Vorige" fontWeight="bold" click="onClick(event)"/>
					<mx:Button id="forwardButton" label=">" fontWeight="bold" click="onClick(event)"/>
					<mx:Button id="refreshButton" label="@" fontWeight="bold" click="onClick(event)"/>
					
				<mx:Label text="URL:" fontWeight="bold"/>
					<mx:TextInput id="urlTextInput" text="{myHTML.location}" width="235" enter="onClick(event)" />
					<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" complete="setHistory()"  x="123" y="0"/>
</mx:WindowedApplication>

Initial URL


Initial Description
Webbrowser I have made with FlashBuilder (Adobe) As3, XML, javascript
Does support Flash, Javascript etc..
Just a testfile, works nice but buggy. Webkit Engine.

Initial Title
[AIR] [FlashBuilder] Webbrowser

Initial Tags


Initial Language
ActionScript 3