I draw inspiration by the excellent tutorial Napolux , Flex 3, Adobe AIR and the API Feedburner , which shows how to write a simple application (or widgets) using Flex 3 Adobe AIR, to show how to accomplish the same thing using Adobe Flash CS3. If you wish, and you can also use the extension for creating Adobe AIR applications. It is not necessary for the purposes of this tutorial, complete the application as an AIR executable, you can use the proposed code as a simple Flash movie to be "affixed" to your Web pages
Flash vs. Flex
Although I appreciate how technology and Adobe AIR as a platform was implemented in HTML (Dreamweaver), Flash and Flex are not "still" quite sympathetic to Flex! I certainly do not compare Flash with Flex, even though they have many similarities but also many differences. However I have absolutely loved the Adobe policy with respect to this spinoff sometimes nonsensical. I would have preferred, instead, the creation of a single environment (Flax) development and not this "useless" separation. In addition, a good programmer, environments too "visual" I do not like crabs and Flex seems destined to become dangerously similar to Visual Basic, which among other things I know very well and I've worked on for many years. In short, I really do not understand Flex and I have not understood what Adobe wants to do with this branch. If Flex is indicated as the ideal place to write what is the fate of Flash RIA? All the features of Flex, not actually available "directly" in the Flash, could - if you want - 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 in the Flash version is the presence of a little 'more code. In fact, Flex solves some procedures directly using "his" MXML file. On closer inspection, however, there is not much more code than you might think. The procedure more substantial, that 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 may work immediately or as a Flash movie as an AIR application on any Web page! Again, if we did not use specific features of a desktop amiente. Moreover, and here's another reason why Flex does not convince me at all, Adobe AIR application is created with Flash 5 times lower 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)
presenti in Actionscript 2.0 e migrati ora sotto Flex! Note: to be honest this is attributable to a number of components (such as'
mx.controls.Alert) that are included in Flex and not in my version of Flash, ActionScript 3.0, in fact, a number of features was Deleted: all "packages"mxpresent in ActionScript 2.0 and Flex migrated now below! However, I reserve as soon as possible to carry out more tests on this.
The code
Deciding whether or not complete our movie as Adobe AIR application (which you can do at any time thereafter), here is the document class Feedburner.as : ( all codes are available on Google Code )
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | 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 .*; . URLLoader ; import flash.net. URLLoader ; . URLRequestMethod ; import flash.net. URLRequestMethod ; . URLLoaderDataFormat ; import flash.net. URLLoaderDataFormat ; . URLRequest ; import flash.net. URLRequest ; . URLVariables ; import flash.net. URLVariables ; FeedBurner extends MovieClip { FeedBurner public class extends MovieClip { String = 'http://api.feedburner.com/awareness/1.0/GetFeedData' ; private const FEEDBURNER_API: String = 'http://api.feedburner.com/awareness/1.0/GetFeedData'; FeedBurner ( ) : void { public function FeedBurner (): void { "construtor::FeedBurner" ) ; trace ("Construtora: FeedBurner"); Event . ADDED_TO_STAGE , init ) ; addEventListener ( Event . ADDED_TO_STAGE, init); } / / init ( e : Event = null ) : void { private function init (e: Event = null): void { = '' ; 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 { checkFeedBurnerReaders private function (e: MouseEvent = null): void { "FeedBurner::checkFeedBurnerReaders()" ) ; trace ("FeedBurner:: checkFeedBurnerReaders ()"); / / : URLLoader = new URLLoader ( ) ; var loader: URLLoader = new URLLoader (); URLRequest = new URLRequest ( ) ; var urlreq: URLRequest = new URLRequest (); URLVariables = new URLVariables ( ) ; var param: URLVariables = new URLVariables (); / / = feed_url . text ; param. feed_url = uri. text; = FEEDBURNER_API ; urlreq. FEEDBURNER_API = url; = URLRequestMethod . GET ; urlreq. method = URLRequestMethod . GET; = param ; urlreq. data = param; / / dataFormat = URLLoaderDataFormat . TEXT ; loader. dataFormat = URLLoaderDataFormat . TEXT; addEventListener ( Event . COMPLETE , completeHandler ) ; loader. addEventListener ( Event . COMPLETE completeHandler); try { load ( urlreq ) ; loader. load (urlreq); ( error : Error ) { } Catch (error: Error ) { "Errore nel caricamento dell' URL" ) ; trace ("Error loading of 'URL'); } event : Event ) : void { completeHandler function (event: Event ): void { / / <rsp Stat="ok"> / / <feed Id="651641" uri="undolog"> / / <entry Date="2008-11-17" circulation="389" hits="1348" downloads="0" reach="43"/> / / </ Feed> / / </ Rsp> XML = XML ( event . target . data ) ; var x_xml: XML = XML (event. target. date); 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 .










Great tutorial too!
Flash or Flex? Flex ... I prefer to be the feeling of "this is for developers, flash is for designers," I do not know. Appearance among other things to see what combination of Thermo
You have updated the script to count the readers of those passed to feedproxy.google.com?
@ Napolux:
No ... my code was educational purposes only
I leave to you the realization of the version "good" 