Adobe Apollo
A whole new lot of technologies arrived this week. Am strating to dirty my hands with them, and its really interesting. All the past months I was excited with the Flex and its stuff. Now, its the turn for Apollo and later this week its for Adobe LiveCycle 2.5 (next version of Flex Data Services 2.0).
I felt this post shall not make sense with no code. So, some code for Apollo to make a simple web browser using the HTML component.
<?xml version="1.0" encoding="utf-8"?>
<mx:ApolloApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" width="100%" height="100%" backgroundGradientColors="[#0080c0, #004080]">
<mx:Style>
Application
{
background-image:"";
background-color:"";
background-alpha:"0.8";
}
</mx:Style>
<mx:Panel width="100%" layout="vertical" height="100%" title="Apollo First" paddingLeft="5" paddingTop="5" paddingBottom="5" paddingRight="5">
<mx:HBox width="100%">
<mx:TextInput width="100%" id="urlPath" text="http://www.google.com"/>
<mx:Button label="GO" id="go" click="onLoadHTML();" />
</mx:HBox>
<mx:TabNavigator width="100%" height="100%" id="htmlTabset" change="this.onTabChange()">
<mx:Canvas label="Site" width="100%" height="100%" id="htmlSiteContainerTab">
<mx:HTML x="0" y="0" width="100%" height="100%" id="htmlSiteContainer" complete="this.onDataLoad()"/>
</mx:Canvas>
<mx:Canvas label="HTML Source" width="100%" height="100%" id="htmlSourceContainer" >
<mx:TextArea x="0" y="0" width="100%" height="100%" id="htmlSource" creationComplete="this.onViewSource()"/>
</mx:Canvas>
</mx:TabNavigator>
<mx:HBox width="100%" height="17">
<mx:Text text="" width="100%" id="statusMessage"/>
</mx:HBox>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
public var htmlSourceText:String = "";
public function onLoadHTML():void {
this.statusMessage.text = "loading site "+this.urlPath.text;
this.htmlSiteContainer.location = this.urlPath.text;
this.htmlSourceText = "loading source...";
}
public function onTabChange():void {
var sc:String = this.htmlTabset.selectedChild.name;
if(sc == "htmlSourceContainer") {
this.onViewSource();
}
}
public function onViewSource():void {
this.htmlSource.text = this.htmlSourceText;
}
public function onDataLoad():void {
this.htmlSourceText = this.htmlSiteContainer.htmlControl.window.document.documentElement.innerHTML
if(this.htmlTabset.selectedChild.name == "htmlSourceContainer") {
this.onViewSource();
}
}
]]>
</mx:Script>
</mx:Panel>
</mx:ApolloApplication>
Download this application
1 comment:
Its a great start moorthy.. happy coding in Apollo!!
Post a Comment