Jawnee
08-13-2008, 01:26 AM
Hey guys! I know nobody likes a newb who hasn't at least tried several different approaches before asking for help so I've invested a fair amount of time trying to make sense of this myself (using w3schools.com, the adobe help files, and my two flash books) prior to coming here with this question.
That said, I'm sure the solution is probably an obvious one. I can almost smell the solution like it's right under my nose but for whatever reason it continues to elude me. Anyhow, enough rambling... onto the problem at hand.
So basically I'm building my first flash site, and I'm pulling information from several different RSS feeds to help give this site some content. The first two feeds (from youtube and picasa) are working fine but I can't seem to get my blogger feed to work for some reason and I'm sure it's a simple node navigation problem.
For reference here is a drastically simplified version of the picasa feed (that works) and the actionscript to access one of the nodes of importance.
Picasa Feed
<?xml version='1.0' encoding='UTF-8'?>
<rss xmlns:atom='http://www.w3.org/2005/Atom'
xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
xmlns:exif='http://schemas.google.com/photos/exif/2007'
xmlns:geo='http://www.w3.org/2003/01/geo/wgs84_pos#'
xmlns:gml='http://www.opengis.net/gml'
xmlns:georss='http://www.georss.org/georss'
xmlns:photo='http://www.pheed.com/pheed/'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:batch='http://schemas.google.com/gdata/batch'
xmlns:gphoto='http://schemas.google.com/photos/2007' version='2.0'>
<channel>
<item>
.
.
<title>Title of item</title>
.
.
</item>
<item>
.
.
.
</channel>
</rss>
Simple call to retrieve the title item above
_galleryXml is the XML object containing the above XML text
trace(_galleryXml.channel.item[0].title.toString());
Nothing to it right? Easy as pie! So what is baffling me is why I cannot navigate my blogger feed in the same way. Below is a simplified version of the blogger XML,(not as simple as the one above in case something I might skip is important) the code I'm trying to use, and error I'm receiving.
<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'>
<id>tag:blogger.com,1999:blog-############</id>
<updated>2008-08-11T20:12:47.330-07:00</updated>
<title type='text'>###### #####</title>
<link rel='alternate' type='text/html' href='http://############.blogspot.com/'/>
<link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://############.blogspot.com/feeds/posts/default'/>
<link rel='self' type='application/atom+xml' href='http://############.blogspot.com/feeds/posts/default'/>
<author>
<name>###</name>
<uri>http://www.blogger.com/profile/##########</uri>
<email>noreply@blogger.com</email>
</author>
<generator version='7.00' uri='http://www.blogger.com'>Blogger</generator>
<openSearch:totalResults>5</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>25</openSearch:itemsPerPage>
<entry>
<id>tag:blogger.com,1999:blog-#########.post-########</id>
<published>2008-08-11T19:46:00.001-07:00</published>
<updated>2008-08-11T20:12:47.350-07:00</updated>
<category scheme='http://www.blogger.com/atom/ns#' term='actionscript3.0'/>
<category scheme='http://www.blogger.com/atom/ns#' term='flash'/>
<category scheme='http://www.blogger.com/atom/ns#' term='travelingtroll'/>
<title type='text'>ActionScript 3.0, moving, and me!</title>
<content>.....</content>
<link rel='alternate' type='text/html' href='http://############.blogspot.com/2008/08/actionscript-30-moving-and-me.html' title='ActionScript 3.0, moving, and me!'/>
<link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=############&postID=############' title='0 Comments'/>
<link rel='replies' type='application/atom+xml' href='http://############.blogspot.com/feeds/############/comments/default' title='Post Comments'/>
<link rel='self' type='application/atom+xml' href='http://############.blogspot.com/feeds/posts/default/##'/>
<link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/######/posts/default/######'/>
<author>
<name>###</name>
<uri>http://www.blogger.com/profile/#########</uri>
<email>noreply@blogger.com</email>
</author>
</entry>
<entry>
.
.
</entry>
</feed>
Attempted calls to retrieve the title item above
_blogXml is the XML object containing the above XML text
trace(_blogXml.entry[0].title.toString());
trace(_blogXml.entry[0].title.(@type = "text").toString());
Each attempt gives me a different error:
TypeError: Error #1010: A term is undefined and has no properties.
at BlogLoader/buildBlogList()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
TypeError: Error #1010: A term is undefined and has no properties.
at BlogLoader/buildBlogList()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
So as far as I can tell feed is the root node in this file, like rss was in the picasa feed. That said I assumed I didn't need to include feed in the trace call. Out of frustration I tried it anyways and it still failed. I noticed the openSearch namespace declaration at the root level as well but as far as I can tell the entry nodes are directly inside of the feed root, and do not require the use of this namespace. Any help anyone can offer would be awesome. I feel like I'm missing something that's either blatantly obvious or just outside of my limited understanding of XML.
That said, I'm sure the solution is probably an obvious one. I can almost smell the solution like it's right under my nose but for whatever reason it continues to elude me. Anyhow, enough rambling... onto the problem at hand.
So basically I'm building my first flash site, and I'm pulling information from several different RSS feeds to help give this site some content. The first two feeds (from youtube and picasa) are working fine but I can't seem to get my blogger feed to work for some reason and I'm sure it's a simple node navigation problem.
For reference here is a drastically simplified version of the picasa feed (that works) and the actionscript to access one of the nodes of importance.
Picasa Feed
<?xml version='1.0' encoding='UTF-8'?>
<rss xmlns:atom='http://www.w3.org/2005/Atom'
xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
xmlns:exif='http://schemas.google.com/photos/exif/2007'
xmlns:geo='http://www.w3.org/2003/01/geo/wgs84_pos#'
xmlns:gml='http://www.opengis.net/gml'
xmlns:georss='http://www.georss.org/georss'
xmlns:photo='http://www.pheed.com/pheed/'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:batch='http://schemas.google.com/gdata/batch'
xmlns:gphoto='http://schemas.google.com/photos/2007' version='2.0'>
<channel>
<item>
.
.
<title>Title of item</title>
.
.
</item>
<item>
.
.
.
</channel>
</rss>
Simple call to retrieve the title item above
_galleryXml is the XML object containing the above XML text
trace(_galleryXml.channel.item[0].title.toString());
Nothing to it right? Easy as pie! So what is baffling me is why I cannot navigate my blogger feed in the same way. Below is a simplified version of the blogger XML,(not as simple as the one above in case something I might skip is important) the code I'm trying to use, and error I'm receiving.
<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'>
<id>tag:blogger.com,1999:blog-############</id>
<updated>2008-08-11T20:12:47.330-07:00</updated>
<title type='text'>###### #####</title>
<link rel='alternate' type='text/html' href='http://############.blogspot.com/'/>
<link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://############.blogspot.com/feeds/posts/default'/>
<link rel='self' type='application/atom+xml' href='http://############.blogspot.com/feeds/posts/default'/>
<author>
<name>###</name>
<uri>http://www.blogger.com/profile/##########</uri>
<email>noreply@blogger.com</email>
</author>
<generator version='7.00' uri='http://www.blogger.com'>Blogger</generator>
<openSearch:totalResults>5</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>25</openSearch:itemsPerPage>
<entry>
<id>tag:blogger.com,1999:blog-#########.post-########</id>
<published>2008-08-11T19:46:00.001-07:00</published>
<updated>2008-08-11T20:12:47.350-07:00</updated>
<category scheme='http://www.blogger.com/atom/ns#' term='actionscript3.0'/>
<category scheme='http://www.blogger.com/atom/ns#' term='flash'/>
<category scheme='http://www.blogger.com/atom/ns#' term='travelingtroll'/>
<title type='text'>ActionScript 3.0, moving, and me!</title>
<content>.....</content>
<link rel='alternate' type='text/html' href='http://############.blogspot.com/2008/08/actionscript-30-moving-and-me.html' title='ActionScript 3.0, moving, and me!'/>
<link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=############&postID=############' title='0 Comments'/>
<link rel='replies' type='application/atom+xml' href='http://############.blogspot.com/feeds/############/comments/default' title='Post Comments'/>
<link rel='self' type='application/atom+xml' href='http://############.blogspot.com/feeds/posts/default/##'/>
<link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/######/posts/default/######'/>
<author>
<name>###</name>
<uri>http://www.blogger.com/profile/#########</uri>
<email>noreply@blogger.com</email>
</author>
</entry>
<entry>
.
.
</entry>
</feed>
Attempted calls to retrieve the title item above
_blogXml is the XML object containing the above XML text
trace(_blogXml.entry[0].title.toString());
trace(_blogXml.entry[0].title.(@type = "text").toString());
Each attempt gives me a different error:
TypeError: Error #1010: A term is undefined and has no properties.
at BlogLoader/buildBlogList()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
TypeError: Error #1010: A term is undefined and has no properties.
at BlogLoader/buildBlogList()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
So as far as I can tell feed is the root node in this file, like rss was in the picasa feed. That said I assumed I didn't need to include feed in the trace call. Out of frustration I tried it anyways and it still failed. I noticed the openSearch namespace declaration at the root level as well but as far as I can tell the entry nodes are directly inside of the feed root, and do not require the use of this namespace. Any help anyone can offer would be awesome. I feel like I'm missing something that's either blatantly obvious or just outside of my limited understanding of XML.