Wednesday, March 11, 2009

[AIR] Twitter from Flex SDK 3.3 + AIR 1.5.1

just try to build some AIR app from latest Flex SDK and AIR and all seem to be work fine with not much line of code to accomplish, nice!, let's see how's thing done...

image

Required?

  1. last Flex SDK and AIR, go get it somewhere here http://www.adobe.com/
  2. handy Twitter gadget http://www.twittergadget.com/
  3. cup of coffee ;)

Code?

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="320" height="480" applicationComplete="init()" borderColor="#000000" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#EEEEEE, #DDDDDD]">
<mx:Script>
<![CDATA[
private var DEFAULT_URI:String = "http://www.google.com";
private function init():void
{
uriInput.text = DEFAULT_URI;
}
private function onGo():void
{
var uri:String = uriInput.text.length>1?uriInput.text:DEFAULT_URI;

var urlRequest:URLRequest = new URLRequest(uri);
htmlOutput.htmlLoader.load(urlRequest);
}
]]>
</mx:Script>
<mx:Grid top="30" left="10" right="10" height="24">
<mx:GridRow width="100%" height="100%">
<mx:GridItem width="100%" height="100%">
<mx:TextInput width="100%" id="uriInput" enter="onGo()"/>
</mx:GridItem>
<mx:GridItem width="48" height="100%">
<mx:Button label="Go!" width="100%" id="goButton" click="onGo()"/>
</mx:GridItem>
</mx:GridRow>
</mx:Grid>
<mx:HTML right="10" top="64" left="10" id="htmlOutput" bottom="10"/>
<mx:Image source="icon/close.png" autoLoad="true" right="10" top="10"/>
<mx:Image source="icon/maximize.png" autoLoad="true" right="30" top="10"/>
<mx:Image source="icon/minimize.png" autoLoad="true" right="50" top="10"/>
<mx:Label x="10" y="10" text="Cute Browser"/>
</mx:WindowedApplication>

More?


  • you can try add more features by your own something like transparent window, chrome less, always on top , more web API, bla bla bla...

Next?


  • now you can see that you can easily build your own twitter client in no more than 1 hour! nice!, if you like it just donate them ( i would love to do that too! but i still stuck at 0$ for my own donate! LOL, that's real life ;o )

  • anyway my Google ads it's rise up to $23 by now (until October 2007) better than nothing lol, thx for whoever clicking my banner, it's not much money i know, but it's made my day somehow ;)

  • let's see what we can apply to AIR app....hmmm...., how about 3D viewer? ;D



Technorati Tags: ,,

1 comment:

Miss Ashley said...

Hey is there anyway you can work in a login with the twitter API into this application? I tried to do it using the code from Tour De Flex and i had NO CLUE how to figure that crap out >.<