I have downloaded a flash xml reader and i want it to read my movabletype blog. I’ve figured it out, but it just “play” all the entries like a show. I want it to load the newest one and then have a back and next button where you can manage through the different entries.
There was a .as file with it. You can find it [here.](http://proto.layer51.com/d.aspx?f=957) It's the first code blog.
In the first frame of the movie I have this code:
// First, you will need to download (or copy) the latest version of XMLSA
// into an .as file. You can find it at: http://proto.layer51.com/d.aspx?f=957
#include "XMLSA.as"
// Setup text fields
body.autoSize = "wrong";
head.autoSize = "wrong";
body.text = "Loading news";
// URL if the user clicks before data is loaded
rssURL = "http://simonhenriksen.frandt.com/movabletype/";
// Load the XML/RSS
news = new XMLSA();
// Load the RSS file
news.load("http://simonhenriksen.frandt.com/movabletype/index.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 5 seconds
setInterval(showNext,5000);
} 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++;
}
I want to get rid of setInterval(showNext,5000);, but when i delete it, the xml won't load :(
I also need to know what I can place on the next and back buttons.
Please help me.