I am new to these forums so I apologize if this question is stupid, but I have an rss feed that I am pulling from an xml file and I want to auto scroll it. Can anyone help me with this issue?
Here’s the code I am currently using.
#include “XMLSA.as”
// Setup text fields
body.autoSize = “right”;
head.autoSize = “right”;
body.text = “Loading ISU news stories”;
// URL if the user clicks before data is loaded
rssURL = “http://www.indstate.edu”;
// Load the XML/RSS
news = new XMLSA();
// Load the RSS file
news.load(“http://www.indstate.edu/news/rss/rss.xml”);
news.onLoad = function(success){
if (success) {
// Check RSS version and make shorthand
if(news.channel[0].item){
// Where to find data items for RSS 0.91
newsNode = news.channel[0];
} else {
// Where to find data items for RSS 1.0 and 2.0
newsNode = news;
}
// Store the number of news items
rssCount = newsNode.item.length;
// Call the showNext function every 30 seconds
setInterval(showNext,30000);
} else {
// Show error message
body.text = “Error loading XML”;
}
}
// Function for getting next entry
showNext = function(){
// Zero the counter if the last article has been shown
if(rssCounter == rssCount || rssCounter == undefined){ rssCounter = 0; }
// Get values from XMLSA array
head.text = newsNode.item[rssCounter].title.getValue();
body.htmlText = newsNode.item[rssCounter].description.getValue();
rssURL = newsNode.item[rssCounter].link.getValue();
// Position the body text below the heading
body._y = head._y + head._height;
// Increment the counter
rssCounter++;
}