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 Says:
    July 26th, 2007 at 1:48 pm

    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 Says:
    January 16th, 2008 at 4:24 pm

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

  3. N2KC Says:
    April 6th, 2008 at 9:30 pm

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

  4. Strife Says:
    February 9th, 2009 at 1:49 pm

    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 Says:
    February 10th, 2009 at 1:48 pm

    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 Says:
    February 10th, 2009 at 2:50 pm

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

  7. Baza Says:
    February 26th, 2009 at 7:33 am

    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 Says:
    March 7th, 2009 at 1:43 am

    No dice. Couldn’t get this to work.

  9. PowPow Says:
    March 25th, 2009 at 4:08 pm

    Davidious, are you publshing with Actionscript 2.0?

  10. Drew Says:
    May 5th, 2009 at 1:44 am

    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 Says:
    May 5th, 2009 at 4:49 pm

    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 Says:
    June 10th, 2009 at 8:47 am

    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 Says:
    June 13th, 2009 at 4:51 pm

    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 Says:
    June 13th, 2009 at 4:51 pm

    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 Says:
    June 25th, 2009 at 3:47 pm

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

  16. jzq Says:
    October 4th, 2009 at 3:42 pm

    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 Says:
    December 30th, 2009 at 8:52 pm

    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 Says:
    February 25th, 2010 at 7:55 am

    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 Says:
    March 2nd, 2010 at 10:21 am

    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. Helmut Granda Says:
    March 2nd, 2010 at 3:59 pm

    I deff need to add a AS3 sample.

  21. Larry Says:
    April 16th, 2010 at 11:29 am

    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?

  22. Oliver Says:
    May 12th, 2010 at 9:59 am

    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