# Parsing RSS/XML with flash

**URL:** <https://forum.kirupa.com/t/parsing-rss-xml-with-flash/184147>\
**Category:** Uncategorized\
**Created:** [April 2, 2006, 6:33pm UTC](https://forum.kirupa.com/t/parsing-rss-xml-with-flash/184147 "2006-04-02T18:33:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![benwh8](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@benwh8](https://forum.kirupa.com/u/benwh8)\
**Post date:** [April 2, 2006, 6:33pm UTC](https://forum.kirupa.com/t/parsing-rss-xml-with-flash/184147/1 "2006-04-02T18:33:31Z")

</div>

Help!

I am currently building an RSS news reader in flash and have run into the slight problem of not being able to access the correct nodes within the XML files. I have managed to parse the first nodes for the XML file info eg BBC RSS file (using; this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue), but when i try and change the nodes that are accessed, eg childNodes[1], to access the main body of the file info, i get a ‘undefined’ result.

Racking my brains, and any help would be much appreciated, thanks!

---

<div class="post-metadata">

**Author:** ![flextnet](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@flextnet](https://forum.kirupa.com/u/flextnet)\
**Post date:** [April 4, 2006, 4:43am UTC](https://forum.kirupa.com/t/parsing-rss-xml-with-flash/184147/2 "2006-04-04T04:43:24Z")

</div>

benwh8, could you show us some code & xml data please?

---

<div class="post-metadata">

**Author:** ![simpleSoft](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@simpleSoft](https://forum.kirupa.com/u/simpleSoft)\
**Post date:** [April 7, 2006, 9:02pm UTC](https://forum.kirupa.com/t/parsing-rss-xml-with-flash/184147/3 "2006-04-07T21:02:18Z")

</div>

I’ve written an RSS class. I have attached the entire class file here. I use it all the time to parse information from RSS 2.0 feeds. It should do everything for you automatically. Copy the object into your program directory in (ie. C:\Program Files\Macromedia\Flash 8).

Once you’ve found that directory go into en\First Run\Classes\

Then add it to FP7, FP8, and/or mx (depends on which version your player is compiled to). Copy everything into com folder close Flash and restart it. …then try this.

```auto

import com.simplifiedsoftware.rss.*;

var RSSObj:RSS = new RSS();

var rssListener:Object = new Object();

rssListener.onRSS = function (eventObj:Object):Void {
     trace(eventObj.status);
     trace(eventObj.success);

     if(eventObj.status ==0 && eventObj.success) {
          trace(eventObj.rss.Version);
          // Outputs the version of the RSS feed.

          trace(eventObj.rss.Title);
          // Outputs the title of the RSS feed.

          trace(eventObj.rss.singleItem(0).Title);
          // Trace the first item in the feed's title.
      }
}

RSSObj.addEventListener("onRSS", rssListener);

RSSObj.load("pathToRSSFeed.xml");

```

I have started to document the Object so you can read everything I got going on [http://simplifiedsoftware.org/projects/rss/](http://simplifiedsoftware.org/projects/rss/)

Let me know if you have any problems or need any help.:azn:
