Adobe AIR and the API Feedburner: reloaded
Tuesday, November 18, 2008I draw inspiration by the excellent tutorial Napolux, Flex 3, Adobe AIR and the Feedburner API, showing you how to write a simple application (or widget) Adobe AIR using Flex 3, to show how to achieve the exact same thing using Adobe Flash CS3. If desired, also, you can use the extension for creating Adobe AIR applications. It is not necessary for the purposes of this tutorial, compile the application as an executable AIR, you can use the proposed code as a simple Flash movie to "affix" to your Web pages
Flash vs Flex
Despite appreciate how technology and Adobe AIR has been deployed in platforms such as HTML (Dreamweaver), Flash and Flex, are not "still" quite well disposed towards Flex! I certainly do not compare Flash with Flex, even though they have many points in common but also many differences. However I have absolutely enjoyed the Adobe policy with respect to this spinoff sometimes meaningless. I would have preferred, instead, the creation of a single environment (Flax) development, and not this "useless" separation. Furthermore, as a good programmer, places too much "visual" I do not like crabs and Flex seems destined to become dangerously similar to Visual Basic, which among other things I know well and which I have worked for many years. In short, Flex I really do not understand and I did not understand what Adobe wants to do with this branch. If Flex is recommended as the ideal place to write what is the fate of Flash RIA? All the features of Flex, not actually available "directly" in Flash, could - wanting - to be inserted without force to purchase multiple licenses to develop - eventually - the exact same thing.
Differences between Flash and Flex
The first thing you'll notice the Flash version is the presence of a little 'more code. Indeed Flex solves some procedures directly using "his" MXML file. Upon closer examination, however, there is more code than you might think. The procedure more dense, which in Flex is "obscured", is the connection via the REST API Feedburner. One of the advantages of using a code written in Flash is that it can work immediately or as AIR applications and as a Flash movie on any Web page! Always if we did not use specific features of a amiente desktop. Moreover, and here's another reason why I am not convinced at all Flex, Adobe AIR application built with Flash is 5 times smaller than that proposed by Napolux and compiled with Flex Builder:
- Feedburner.air (Flash) 59.1 KB (60,576 bytes)
- Feedburner.air (Flex) 316 KB (323,584 bytes)
Note: To be fair this is attributable to a number of components (such as'
mx.controls.Alertthat are included in Flex and not in my version of Flash, ActionScript 3.0, in fact, a number of features was eliminated: all "packages"mxpresent in Actionscript 2.0 and Flex migrated now below! However I intend to carry out more tests as soon as possible in this regard.
Code
Deciding whether or not complete our movie as an Adobe AIR application (which you can do at any time thereafter), here's the document class Feedburner.as: (all codes are available on Google Code)
- package (
- / **
- * Class Document for Adobe AIR version FeedBurner
- * Original idea by Napolux.com (http://www.napolux.com/2008/flex-3-adobe-air-feedburner.html)
- *
- * @ Author Giovambattista Fazioli
- * @ Email @ g.fazioli undolog.com
- * @ Web http://www.undolog.com
- *
- * CHANGE LOG
- *
- * Ver 0.8
- * - First release Adobe AIR
- *
- * /
- .*; import flash.display .*;
- .*; import flash.text .*;
- .*; import flash.events .*;
- FeedBurner ( ) : void { public function FeedBurner (): void (
- "construtor::FeedBurner" ) ; trace ( "Construtor:: FeedBurner");
- )
- / /
- = '' ; result_txt. text ='';
- = 'http://www.undolog.com/feed' ; feed_url. text = 'http://www.undolog.com/feed';
- / /
- ( MouseEvent . CLICK , checkFeedBurnerReaders ) ; check_btn. addEventListener (MouseEvent. CLICK, checkFeedBurnerReaders);
- )
- / /
- checkFeedBurnerReaders ( e : MouseEvent = null ) : void { private function checkFeedBurnerReaders (e: MouseEvent = null): void (
- "FeedBurner::checkFeedBurnerReaders()" ) ; trace ( "FeedBurner:: checkFeedBurnerReaders ()");
- / /
- / /
- = feed_url . text ; param. uri = feed_url. text;
- = FEEDBURNER_API ; urlReq. url = FEEDBURNER_API;
- = param ; urlReq. data = param;
- / /
- try (
- load ( urlreq ) ; loader. load (urlReq);
- "Errore nel caricamento dell' URL" ) ; trace ( "Error Loading 'URL');
- )
- / / <rsp stat="ok">
- / / <feed Id="651641" uri="undolog">
- / / <entry Date="2008-11-17" circulation="389" hits="1348" downloads="0" reach="43"/>
- / / </ Feed>
- / / </ rsp>
- x_xml . @stat == 'ok' ) result_txt . text = x_xml . feed . entry . @circulation . toString ( ) ; if (x_xml. @ stat == 'ok') result_txt. text = x_xml. feed. entry. @ circulation. toString ();
- text = '0' ; result_txt else. text = '0 ';
- )
- )
- )
- )
The part of the interface is available on Feedburner.fla.













Also your excellent tutorial!
Flash or Flex? I prefer Flex ... Perhaps it is the feeling of "this is for developers, flash designer," I do not know. Appearance among other things to see what combination of Thermo
Did you update the script to count the readers of those passed to feedproxy.google.com?
@ Napolux:
No. .. My code was planning purposes only
I leave to you the realization of the version "good" 