Wednesday, February 4, 2009

Flex - Source code for creating a rss reader for your blog in flex

Source code for creating a rss reader for your blog in flex.Use this
code to create your rss reader using flex builder or flex plugin

I have used flex plugin with Eclipse IDE 3.2


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
width="600"
height="500"
horizontalAlign="center"
verticalAlign="middle"
backgroundColor="#7F7F7F">

!--<mx:HTTPService showBusyCursor="true" id="RSSfeed"
url="http://wallpaperboss.blogspot.com/feeds/posts/default?alt=rss"
resultFormat="object" /> -->
<mx:HTTPService showBusyCursor="true" id="RSSfeed"
url="http://picsweb.blogspot.com/feeds/posts/default?alt=rss"
resultFormat="object" />

<mx:Panel width="600" height="500" layout="absolute"
horizontalCenter="0" verticalCenter="0" resizeEffect="Resize"
backgroundColor="#7F7F7F" title="Bollywood Blog ">
<mx:DataGrid width="580" height="100" id="entries"
dataProvider="{RSSfeed.lastResult.rss.channel.item}"
click="{body.htmlText+=RSSfeed.lastResult.rss.channel.item[entries.selectedIndex].description}"
horizontalCenter="0"
verticalCenter="-180">
<mx:columns> <mx:DataGridColumn dataField="pubDate"
headerText="Date"/>
<mx:DataGridColumn dataField="title" headerText="Title"/>
</mx:columns>
</mx:DataGrid>

<mx:TextArea width="580" height="320" id="body" verticalCenter="60"
horizontalCenter="0" verticalScrollPolicy="on" >
<mx:filters>
<flash.filters:DropShadowFilter
xmlns:flash.filters="flash.filters.*"
blurX="5" blurY="5"
distance="3" angle="45" color="0x000000" alpha="0.4" />
</mx:filters>
</mx:TextArea>

<mx:Button toolTip="Click to load recent posts" label="Check"
click="RSSfeed.send()" verticalCenter="-113" horizontalCenter="0">
<mx:filters>
<flash.filters:DropShadowFilter
xmlns:flash.filters="flash.filters.*"
distance="3" angle="90" color="0x000000"
alpha="0.4" />
</mx:filters>
</mx:Button>
<mx:Label x="9" y="140" htmlText="<a
href="#">http://picsweb.blogspot.com</a>" fontWeight="bold"/>

</mx:Panel>
</mx:Application>