#眉標=Adobe AIR #副標=網路桌面應用開發(1) #大標=Adobe AIR實作RSS讀取器 #作者=文/圖 劉仲濱 ============= 程式1 ================ ==<反灰>=========== [SWF reference is generated]============== ============= 程式2 ================ ============= 程式碼3 package events { import flash.events.Event; public class ReadArticleCustomClass extends Event { public var article:Object; public function ReadArticleCustomClass(articleParam:Object,type:String) { super(type,true); this.article = articleParam; } override public function clone():Event { return new ReadArticleCustomClass(article,type); } } } ================ ==<反灰>=========== [Event(name="readArticle",type="events.ReadArticleCustomClass")] ================ ============= 程式4 ================ ============= 程式碼5 private function initApp():void { FeedDisplay.addEventListener("readArticle",showArticle); } private function showArticle(event:ReadArticleCustomClass):void { currentArticle = event.article.link; currentArticleLink = event.article["rdf:about"]; ContentNavigator.selectedIndex = 1; } private function rssHandler(event:ResultEvent):void { rssFeedData = event.result.RDF.item; RssLoader.height=0; } private function showArticleTab():void { if (articleLoader.location != currentArticleLink) articleLoader.location = currentArticle; articleLoader.loaded?HtmlLoader.height=0:HtmlLoader.height=30; } ================