Loading a RSS feed into Flash

ActionScript:
    // create a new XML object
    var sports:XML = new XML();

    // set the ignoreWhite property to true (default value is false)
    sports.ignoreWhite = true;

    // After loading is complete, trace the XML object
    sports.onLoad = function(success) {
      trace(sports);
    };

    // load the XML into the sports object
    sports.load("http://rss.news.yahoo.com/rss/sports");

22 Responses to “Loading a RSS feed into Flash”

  1. Martin Dimitrov July 26, 2007 at 1:48 pm # Reply

    Helmut, pardon my ignorance, I tried to solve it myself but with no success…
    I want to use your “Loading RSS feed into Flash” script and it works fine, but I do not know how to capture the output and save it as an xml file. My ultimate objective is to have just the entries from the xml displayed in a list component.
    Best regards,
    Martin

  2. Flash_lover January 16, 2008 at 4:24 pm # Reply

    This is cool but I can’t see the info, I can see it in the output box
    only.

  3. N2KC April 6, 2008 at 9:30 pm # Reply

    Yesssss. Finally. Just the base code of loading the RSS, not some super long and advanced script. :D

  4. Strife February 9, 2009 at 1:49 pm # Reply

    Hey guys, to pull the feed into a text field, follow these steps:

    Create a dynamic multiline text field and give it a variable name, i.e. txt_feed.

    Then just insert this script into the onLoad function:

    sports.onLoad = function(success) {
    txt_feed = sports;
    trace(sports);
    };

  5. mathias February 10, 2009 at 1:48 pm # Reply

    I still just get it in my output window :(

    Is there any way to combine this with:

    function loadXML(loaded) {
    if (loaded) {
    xmlNode = this.firstChild;
    caption = [];
    url = [];
    total = xmlNode.childNodes.length;
    for (i=0; i=0) {
    newsMC.newsText._alpha -= 5;
    } else {
    display(p);
    p++;
    delete this.onEnterFrame;
    }
    };
    }

  6. mathias February 10, 2009 at 2:50 pm # Reply

    hum… the whole message didn’t show up.
    Check out http://www.maihtas.com/flash_news_ticker.html

  7. Baza February 26, 2009 at 7:33 am # Reply

    Hey guys.
    I’ve set up all the code and made a dynamic multiline text field for the feed to goto, yet still I can only see my feed in the output box!
    Any ideas?

  8. Davidious March 7, 2009 at 1:43 am # Reply

    No dice. Couldn’t get this to work.

  9. PowPow March 25, 2009 at 4:08 pm # Reply

    Davidious, are you publshing with Actionscript 2.0?

  10. Drew May 5, 2009 at 1:44 am # Reply

    i get it all to work but it just displays the source of the XML file, can i get it to display specific tags, or even format the content inside my text field?

  11. Helmut Granda May 5, 2009 at 4:49 pm # Reply

    It is supposed to show you only the output (text) to use as a blue print. With the content now you can target specific tags or do as you wish with it :)

  12. Jason Sartain June 10, 2009 at 8:47 am # Reply

    please forgive my ignorance… I’m totally a begginer and have only used flash for motion files in the past, and I understand very little about web stuff. I want to place this feed from my external blog in a box on my “blog” page in my flash site… and of course have it link to the external blog site, if they want to read more. I put this code in an action box on a layer in the keyframe of my “content page” movie designated for that page content. I used the code, and like you said the output showed that it works… what do I do next in order to set the parameters for this feed to show up on that page in a box or whatever the size of my choosing? thank you in advance for any help you can give… I feel like I’m in over my head,… :) thanks a bunch!

  13. BGS June 13, 2009 at 4:51 pm # Reply

    I managed to get this to work no problem. Now my question is.. is it possible to have the photos from the blog that is getting fed into flash show up and also, is there a way to make this look a little more organized? as of now im getting the text from the blog, but there is no space between each blog.

  14. BGS June 13, 2009 at 4:51 pm # Reply

    I managed to get this to work no problem. Now my question is.. is it possible to have the photos from the blog that is getting fed into flash show up and also, is there a way to make this look a little more organized? as of now im getting the text from the blog, but there is no space between each blog.

    Thanks

  15. Byron Levene June 25, 2009 at 3:47 pm # Reply

    Im doing somthing wrong because te feed is coming thru but its not rendering its just showing the source.

  16. jzq October 4, 2009 at 3:42 pm # Reply

    It works fine ! If its not showing in the text box i would suggest clicking “embed…” under the properties of the txt box and selecting they data you want to display !

    If that doesnt work then i dont know.

  17. Rob B December 30, 2009 at 8:52 pm # Reply

    I’m working in actionscript 2.0 and want to be able to use my rss blog feed for the news segment. I’m having the same problem, the rss feed only shows up in the output pane.

  18. hii February 25, 2010 at 7:55 am # Reply

    about RSS comment in AS3

    hii there I like to know now to create/add RSS comment into an flash website using with AS3

  19. Tyler March 2, 2010 at 10:21 am # Reply

    If you’re working in AS2 the only thing that needs to be done to integrate this to the stage is to first create a dynamic text box named “number1_txt” and add the following:

    sports.onLoad = function(success) {
    trace(sports);
    _root.uno = this.firstChild.childNodes[0].childNodes[0].childNodes[0].firstChild.nodeValue;
    number1_txt.text = _root.uno;
    };

    You work your way through your rss feed/xml by changing the [0]‘s in that code. but that code should give you something to start with.

  20. Larry April 16, 2010 at 11:29 am # Reply

    Thanks for the great tutorial… I still can’t quite make it work. In the dynamic text field (I’m using as2) it says, “undefined.”

    The feed is showing up in the output box… not sure what to do.

    What does it mean to work through the feed by changing the [0]‘s?

  21. Oliver May 12, 2010 at 9:59 am # Reply

    I’m trying it with AS 2 Flash player 10 settings.
    All I get is the text “eie” in the field, but there is no such text in the rss feed, or in the script.. Can this work?

Leave a Reply