Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Desktop, Mobile and non-browser Environments > AIR (Apollo)

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-09-2007, 10:56 PM   #1
1somniac
Registered User
 
Join Date: Aug 2007
Posts: 8
Default Why does my RSS Reader is buggy for some RSS ?

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>
Here is the ItemRenderer file :
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>
I have this error message :
Quote:
TypeError: Error #1010: A term is undefined and has no properties.
the error is located in this function :
Code:
[Bindable] private var rssFeedData:ArrayCollection;
private function rssHandler(event:ResultEvent):void
{
  rssFeedData = event.result.RDF.item;
}
Why would a term being undefined for some RSS data and not for other ?
Does any of you have an idea to handle it ?

thank you
1somniac is offline   Reply With Quote
Old 09-10-2007, 06:10 PM   #2
dr_zeus
Flash Adventurer
 
dr_zeus's Avatar
 
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,975
Default

There are several versions of RSS out there. If you want a more general solution, I recommend using the open source AS3 Syndication Library.
__________________
Josh Tynjala | JOSHBLOG | Bowler Hat Games
dr_zeus is offline   Reply With Quote
Old 09-10-2007, 11:17 PM   #3
1somniac
Registered User
 
Join Date: Aug 2007
Posts: 8
Default

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?
1somniac is offline   Reply With Quote
Old 09-11-2007, 06:00 PM   #4
dr_zeus
Flash Adventurer
 
dr_zeus's Avatar
 
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,975
Default

Do the sites from which you're trying to load RSS have crossdomain.xml?
__________________
Josh Tynjala | JOSHBLOG | Bowler Hat Games
dr_zeus is offline   Reply With Quote
Old 09-11-2007, 11:50 PM   #5
1somniac
Registered User
 
Join Date: Aug 2007
Posts: 8
Default

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
1somniac is offline   Reply With Quote
Old 09-12-2007, 06:01 PM   #6
dr_zeus
Flash Adventurer
 
dr_zeus's Avatar
 
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,975
Default

If you're using AIR, then you don't need to worry about crossdomain.xml. That only applies to browser-based applications.
__________________
Josh Tynjala | JOSHBLOG | Bowler Hat Games
dr_zeus is offline   Reply With Quote
Old 09-12-2007, 10:07 PM   #7
1somniac
Registered User
 
Join Date: Aug 2007
Posts: 8
Default

thank you for your answer!

But I would like to make my RSS reader work. What could I do ?
1somniac is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT. The time now is 07:23 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.