PDA

View Full Version : Flash RSS Banner


SollyNZ
05-25-2009, 11:42 AM
Hi There,

I need help with an RSS Web banner that was built for me. The person who made it has dissapeared and i cant get in contact him.

Bassically i have a flash banner that pulls and displays an rss feed from a website. When the movie loops it reloads the flash rss feed. So bassically everytime the movie loops its reloading the rss file. This is causing to much load on the servers hosting the file.

I want it so that when the movie loops, instead of reloading the rss file, the file just displays the data that was pulled the first time the file was pulled.

I really need some help with this and urgently.

This is the code that is in the file at the moment

import com.cybozuLab.rssParser.*;
if (rss == undefined) {
var rrs:String = 'http://www.stuff.co.nz/rss/business';
}
// create FetchingRss class instance
// set the target RSS URL
var rssObj = new FetchingRss("http://www.stuff.co.nz/rss/business");

// pointer to this MovieClip
var thisObj = this;
// define the function when loading is completed
rssObj.onLoad = function(successFL, errMsg) {
if (successFL) {
// call function for listing summary
thisObj.loadPost();
} else {
trace(errMsg);
}
};

// start loading
rssObj.load();
titles = new Array();
times = new Array();
links = new Array();
function loadPost() {
for (i=0; i<1; i++) {
var rssData:Object = rssObj.getRssObject();
var post:Object = rssData.channel.item[1];
titles.push(post.title.value);
startSlice = post.pubDate.value.indexOf('2009')+4;
checkAMPM = post.pubDate.value.slice(startSlice+10, startSlice+15)
theTime = post.pubDate.value.slice(startSlice, startSlice+6);
if(checkAMPM == '-1200'){
theTime += 'pm';
}else{
theTime += 'am';
}
times.push(theTime);
links.push(post.link.value);
}
onLoaded();
}

onLoaded = function () {
for (i=0; i<5; i++) {
this['post'+i].newss.txt.text = titles[i];
this['post'+i].latest.time_txt.text = times[i];
}
post0.btn.onRelease = function() {
getURL(links[0], '_blank');
};
post1.btn.onRelease = function() {
getURL(links[1], '_blank');
};
post2.btn.onRelease = function() {
getURL(links[2], '_blank');
};
post3.btn.onRelease = function() {
getURL(links[3], '_blank');
};
post4.btn.onRelease = function() {
getURL(links[4], '_blank');
};
};

pixelwit
05-25-2009, 12:55 PM
Ooooh... I like the easy questions.

//
//
import com.cybozuLab.rssParser.*;
//
//
if(alreadyRan != true){
if (rss == undefined) {
var rrs:String = 'http://www.stuff.co.nz/rss/business';
}
// create FetchingRss class instance
// set the target RSS URL
var rssObj = new FetchingRss("http://www.stuff.co.nz/rss/business");

// pointer to this MovieClip
var thisObj = this;
// define the function when loading is completed
rssObj.onLoad = function(successFL, errMsg) {
if (successFL) {
// call function for listing summary
thisObj.loadPost();
} else {
trace(errMsg);
}
};
//
// start loading
rssObj.load();
titles = new Array();
times = new Array();
links = new Array();
function loadPost() {
for (i=0; i<1; i++) {
var rssData:Object = rssObj.getRssObject();
var post:Object = rssData.channel.item[1];
titles.push(post.title.value);
startSlice = post.pubDate.value.indexOf('2009')+4;
checkAMPM = post.pubDate.value.slice(startSlice+10, startSlice+15)
theTime = post.pubDate.value.slice(startSlice, startSlice+6);
if(checkAMPM == '-1200'){
theTime += 'pm';
}else{
theTime += 'am';
}
times.push(theTime);
links.push(post.link.value);
}
onLoaded();
}
onLoaded = function () {
for (i=0; i<5; i++) {
this['post'+i].newss.txt.text = titles[i];
this['post'+i].latest.time_txt.text = times[i];
}
post0.btn.onRelease = function() {
getURL(links[0], '_blank');
};
post1.btn.onRelease = function() {
getURL(links[1], '_blank');
};
post2.btn.onRelease = function() {
getURL(links[2], '_blank');
};
post3.btn.onRelease = function() {
getURL(links[3], '_blank');
};
post4.btn.onRelease = function() {
getURL(links[4], '_blank');
};
};
}
//
//
var alreadyRan = true;
//
//

-PiXELWiT
http://www.pixelwit.com