| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 | |
|
Registered User
Join Date: Aug 2007
Posts: 8
|
Hi,
I am trying build an RSS reader from an adobe tutorial . This reader can read the RSS given by adobe works as example, but most of the RSS doesn't and I don't know why. Here is the code in my Main file Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable] private var rssFeedData:ArrayCollection;
private function rssHandler(event:ResultEvent):void
{
rssFeedData = event.result.RDF.item;
}
]]>
</mx:Script>
<mx:HTTPService id="RssService" url="http://weblogs.macromedia.com/mxna/xml/rss.cfm?query=byMostRecent"
result="rssHandler(event)"/>
<!--For displaying data -->
<mx:TabNavigator
id="ContentNavigator"
width="860" height="540"
x="10" y="10" paddingTop="5" paddingRight="5" paddingBottom="5" paddingLeft="5">
<mx:VBox label="Articles"
width="100%" height="100%"
verticalGap="0" paddingTop="10" paddingRight="10" paddingBottom="10" paddingLeft="10">
<mx:Box width="100%" height="33"
backgroundColor="#B8AF9C" cornerRadius="15" paddingBottom="5" paddingLeft="10" paddingRight="5" paddingTop="5">
<mx:Button label="Fetch RSS" click="RssService.send();RssLoader.height=30"/>
</mx:Box>
<mx:Box id="RssLoader"
width="100%" height="0"
backgroundColor="#B8AF9C" paddingTop="6" paddingRight="10" paddingBottom="5" paddingLeft="10">
<mx:ProgressBar id="rssProgress"
indeterminate="true"
barColor="#B8AF9C"
width="100%"
labelPlacement="center"
label="loading feed"/>
</mx:Box>
<mx:TileList id="FeedDisplay"
width="100%" height="100%"
maxColumns="1"
rowHeight="120" columnWidth="810"
itemRenderer="ItemRenderer"
dataProvider="{rssFeedData}"/>
</mx:VBox>
</mx:TabNavigator>
</mx:Application>
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:DateFormatter id="dateFormatter" formatString="D-MMM-YY"/>
<mx:Text id="Title"
htmlText="{data.title}"
x="5" y="0"
fontSize="11" selectable="false"
width="780"
textAlign="left" fontWeight="bold"/>
<mx:Text id="PublishDate"
text="{dateFormatter.format(data.date)}"
x="5" y="{Title.height+3}"
fontSize="9" selectable="false"
width="200"
textAlign="left"
fontWeight="bold"/>
<mx:Text id="Author"
text="{data.creator}"
x="68" y="{Title.height+3}"
fontSize="9" selectable="false"
width="200"
textAlign="left" fontWeight="bold"/>
<mx:LinkButton id="ReadArticle"
label="> read article"
x="700" y="{Title.height-3}"
fontSize="10"
rollOverColor="#B8AF9C"
selectionColor="#595341"
textRollOverColor="#FFFFFF"
textSelectedColor="#FFFFFF"/>
<mx:Text id="Description"
htmlText="{data.description}"
x="5" y="{Title.height+20}"
fontSize="10" selectable="false"
width="780"
textAlign="left"/>
<mx:HRule x="0" y="115" width="100%"/>
</mx:Canvas>
Quote:
Code:
[Bindable] private var rssFeedData:ArrayCollection;
private function rssHandler(event:ResultEvent):void
{
rssFeedData = event.result.RDF.item;
}
Does any of you have an idea to handle it ? thank you |
|
|
|
|
|
|
#2 |
|
Flash Adventurer
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,975
|
There are several versions of RSS out there. If you want a more general solution, I recommend using the open source AS3 Syndication Library.
|
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Aug 2007
Posts: 8
|
I also tried this library, I tried an example of the use of the library given here :
http://orangeflash.eu/?p=18 But there is still the same problem. In any RSS example I tried, i'm facing the same bug : the RSS can't be read. Here is another Flash RSS reader link :http://thewarp.org/flex/blogreader.html If I put any other RSS link than the given one, it result in an error. It's maybe bug from my computer? |
|
|
|
|
|
#4 |
|
Flash Adventurer
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,975
|
Do the sites from which you're trying to load RSS have crossdomain.xml?
|
|
|
|
|
|
#5 |
|
Registered User
Join Date: Aug 2007
Posts: 8
|
I have just take some documentation on crossdomain.xml, and i have just read that it need a server-side proxy method in order to run the file.
The trouble is that i am developping with Adobe Air, which mean that I can't use a server side langage for uploading file. Any help ?? thank you |
|
|
|
|
|
#6 |
|
Flash Adventurer
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,975
|
If you're using AIR, then you don't need to worry about crossdomain.xml. That only applies to browser-based applications.
|
|
|
|
|
|
#7 |
|
Registered User
Join Date: Aug 2007
Posts: 8
|
thank you for your answer!
But I would like to make my RSS reader work. What could I do ? |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with pulling RSS feeds in XML | Zarkus | ActionScript 2.0 | 0 | 08-02-2007 06:35 PM |
| simple rss reader doesn't recognize quote marks | divergus | ActionScript 2.0 | 0 | 05-19-2007 09:48 PM |