Apollo makes the tintrnet possible
Published by admin April 19th, 2007 in Flash Platform, TutorialsWhen I first saw the demos of Apollo and the HTML element with it's ability to be manipulated as if it's a MovieClip an idea popped into my mind.
It's taken a while for me to get the time and inclination to play with Apollo, Mike Downey's talk at LFPUG on Tuesday was enough of a reminder that I really should have a go.
So, my first Apollo app is tintrnet, it's a very poor visual pun on the colloquialism t'internet, literally tinting the internet, I dropped the "e" just to make it a little bit more Web 2.0
The bulk of the code is pilfered from flashgen.com, obviously the addition of the colour picker is where the bulk of the work was, that and getting the colour transform to behave.
-
<?xml version="1.0" encoding="utf-8"?>
-
<mx:ApolloApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="820" height="640" applicationComplete="loadURL('http://www.google.com')">
-
<mx:Script>
-
<![CDATA[
-
private function loadURL(uri:String) :void {
-
browser.location = uri;
-
}
-
private function setURL(uri:String) :void {
-
url_txt.text = uri;
-
}
-
private function setTint ( ) : void {
-
var hex : Number = picker.selectedColor ;
-
var red : Number = hex>>16;
-
var grnBlu : Number = hex-(red<<16);
-
var grn : Number = grnBlu>>8;
-
var blu : Number = grnBlu-(grn<<8);
-
browser.transform.colorTransform = new ColorTransform(1, 1, 1, 1, red , grn , blu , 0);
-
}
-
]]>
-
</mx:Script>
-
<mx:Panel id="holder_panel" layout="absolute" width="100%" height="100%" x="0" y="0">
-
<mx:Label x="7" y="7" text="tintrnet (beta)"/>
-
<mx:TextInput id="url_txt" x="105" y="5" width="581" editable="true" enabled="true" />
-
<mx:Button id="go_btn" x="703" y="5" label="GO" click="loadURL(url_txt.text)"/>
-
<mx:ColorPicker id="picker" x="760" y="5" change="setTint()" />
-
<mx:HTML id="browser" width="100%" height="100%" y="30" locationChange="setURL(browser.location)" />
-
</mx:Panel>
-
</mx:ApolloApplication>
This was just a bit of fun and a nice little taster of Apollo.
I forgot to add the air file for download: tintrnet.air
And here's a link to the runtime if you haven't already got it: Apollo Runtime
No Responses to “Apollo makes the tintrnet possible”
Please Wait
Leave a Reply