Loading a RSS feed into Flash
Posted by Helmut Granda | Filed under ActionScript, Programming, Tutorials
- // 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”
-
Martin Dimitrov Says:
July 26th, 2007 at 1:48 pmHelmut, 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 -
Flash_lover Says:
January 16th, 2008 at 4:24 pmThis is cool but I can’t see the info, I can see it in the output box
only. -
N2KC Says:
April 6th, 2008 at 9:30 pmYesssss. Finally. Just the base code of loading the RSS, not some super long and advanced script.
-
Strife Says:
February 9th, 2009 at 1:49 pmHey 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);
}; -
mathias Says:
February 10th, 2009 at 1:48 pmI 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;
}
};
} -
mathias Says:
February 10th, 2009 at 2:50 pmhum… the whole message didn’t show up.
Check out http://www.maihtas.com/flash_news_ticker.html -
Baza Says:
February 26th, 2009 at 7:33 amHey 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? -
Davidious Says:
March 7th, 2009 at 1:43 amNo dice. Couldn’t get this to work.
-
PowPow Says:
March 25th, 2009 at 4:08 pmDavidious, are you publshing with Actionscript 2.0?
-
Drew Says:
May 5th, 2009 at 1:44 ami 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?
-
Helmut Granda Says:
May 5th, 2009 at 4:49 pmIt 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
-
Jason Sartain Says:
June 10th, 2009 at 8:47 amplease 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! -
BGS Says:
June 13th, 2009 at 4:51 pmI 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.
-
BGS Says:
June 13th, 2009 at 4:51 pmI 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
-
Byron Levene Says:
June 25th, 2009 at 3:47 pmIm doing somthing wrong because te feed is coming thru but its not rendering its just showing the source.
-
jzq Says:
October 4th, 2009 at 3:42 pmIt 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.
-
Rob B Says:
December 30th, 2009 at 8:52 pmI’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.
-
hii Says:
February 25th, 2010 at 7:55 amabout RSS comment in AS3
hii there I like to know now to create/add RSS comment into an flash website using with AS3
-
Tyler Says:
March 2nd, 2010 at 10:21 amIf 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.
-
Helmut Granda Says:
March 2nd, 2010 at 3:59 pmI deff need to add a AS3 sample.
-
Larry Says:
April 16th, 2010 at 11:29 amThanks 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?
-
Oliver Says:
May 12th, 2010 at 9:59 amI’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?