<s:Panel right="0" left="0" top="0" bottom="0">
<mx:HTML x="0" y="40" width="100%" height="92%" id="htmlBrowser" htmlText="AP.Media"/>
<mx:TextInput x="0" y="5" height="0" width="0" text="http://" id="urlInputer" enter="__onGoSurf(null)" styleName="nourl"/>
<mx:Button click="htmlBrowser.historyBack()" right="66" y="-31" icon="@Embed(source='asset/back_link.png')" id="back" width="30" height="30"/>
<mx:Button click="htmlBrowser.historyForward()" right="26" y="-31" icon="@Embed(source='asset/next.png')" id="next" width="30" height="30"/>
<mx:Button y="-32" right="106" width="30" id="goRun" icon="@Embed(source='asset/arrow_circle_225.png')" height="30"/>
<mx:Button y="-31" icon="@Embed(source='asset/cottage_type.png')" width="30" id="googleBtn" right="145" height="30" />
</s:Panel>
<fx:Script>
<!--[CDATA[
import flash.events.HTMLUncaughtScriptExceptionEvent;
import flash.events.IOErrorEvent;
import flash.filesystem.*;
[Bindable]
private var file:File;
private var fileStream:FileStream;
private var fileName:String = "config.ini";
private var directory:String = "SimpleSaveFromAIR";
private function init():void
{
var newhost:HTMLHost = new HTMLHost;
htmlBrowser.htmlHost = newhost;
htmlBrowser.htmlLoader.navigateInSystemBrowser = false;
htmlBrowser.htmlLoader.htmlHost = newhost;
NativeApplication.nativeApplication.icon.bitmaps=new Array(new Bitmap(new BitmapData(16,16,false,0xccff00)));
configListener();
htmlBrowser.location = 'http://192.168.1.47/frimann2/admin/index.php?id=bob';
//write file
var file:File =File.applicationStorageDirectory.resolvePath("HelloWorld.txt");
var stream:FileStream = new FileStream()
stream.open(file, FileMode.WRITE);
var str:String = "Congratulations on your 1st file, Rich Tretola - EverythingFlex.com";
stream.writeUTFBytes(str);
stream.close();
stream.open(file,FileMode.READ);
var parseStr:String=stream.readUTFBytes(stream.bytesAvailable);
mx.controls.Alert.show(parseStr+" /n" + file.nativePath, "Notice");
}
private function configListener():void
{
htmlBrowser.addEventListener(Event.LOCATION_CHANGE, __onHtmlLocation);
htmlBrowser.htmlLoader.addEventListener(HTMLUncaughtScriptExceptionEvent.UNCAUGHT_SCRIPT_EXCEPTION, __onScriptError);
goRun.addEventListener(MouseEvent.CLICK, __onGoSurf);
//stopLoad.addEventListener(MouseEvent.CLICK, __onStopLoading);
//historyBack.addEventListener(MouseEvent.CLICK, __onHistoryBack);
googleBtn.addEventListener(MouseEvent.CLICK, __onGoogleButton);
}
private function __onHtmlLocation(e:Event):void
{
urlInputer.text = htmlBrowser.location;
}
private function __onGoSurf(e:Event):void
{
if(urlInputer.text.toLowerCase().indexOf("://",0)<0){
urlInputer.text = "http://" + urlInputer.text;
}
htmlBrowser.location = urlInputer.text;
}
private function __onStopLoading(e:Event):void
{
htmlBrowser.cancelLoad();
}
private function __onHistoryBack(e:Event):void
{
htmlBrowser.historyBack();
}
private function __onGoogleButton(e:Event):void
{
htmlBrowser.location = "http://www.google.com/";
}
private function __onScriptError(e:HTMLUncaughtScriptExceptionEvent):void
{
trace(e.exceptionValue);
}
]]-->
</fx:Script>
</s:WindowedApplication>