Hello all,
I have a basic image/link rotater. It loads from a XML file and images from a directory. What I'm trying to do is add a alpha tween to images as they are loaded. Here is my action script:
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("logo_scroller.xml"
;
slides_xml.ignoreWhite = true;
//
// Show the first slide and intialize variables
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);
}
}
//
// Updates the current slide with new image and text
function updateSlide(newSlideNode) {
imagePath = newSlideNode.attributes.jpegURL;
URLTarget = newSlideNode.attributes.URLTarget;
slideText = newSlideNode.firstChild.nodeValue;
targetClip.loadMovie(imagePath);
}
//
obj = new Object();
obj.interval = function(){
//this is where you will advance your movie to the correct node
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);
} else {
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
}
setInterval(obj,"interval",5000);
time = new Object();
function (time){
getTimer();
if (time >=10000){
delete (obj);
}
clearInterval (interval);
}
//
This is my script to fade in the image
if (a<=100) {
setProperty("/targetClip", _alpha, a);
a = a+5;
}
I can get it to fade in when I load the first image, but can't get it to run when it loads the next image(s)
Any Ideas? Thanks in advance.
I have a basic image/link rotater. It loads from a XML file and images from a directory. What I'm trying to do is add a alpha tween to images as they are loaded. Here is my action script:
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("logo_scroller.xml"
slides_xml.ignoreWhite = true;
//
// Show the first slide and intialize variables
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);
}
}
//
// Updates the current slide with new image and text
function updateSlide(newSlideNode) {
imagePath = newSlideNode.attributes.jpegURL;
URLTarget = newSlideNode.attributes.URLTarget;
slideText = newSlideNode.firstChild.nodeValue;
targetClip.loadMovie(imagePath);
}
//
obj = new Object();
obj.interval = function(){
//this is where you will advance your movie to the correct node
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);
} else {
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
}
setInterval(obj,"interval",5000);
time = new Object();
function (time){
getTimer();
if (time >=10000){
delete (obj);
}
clearInterval (interval);
}
//
This is my script to fade in the image
if (a<=100) {
setProperty("/targetClip", _alpha, a);
a = a+5;
}
I can get it to fade in when I load the first image, but can't get it to run when it loads the next image(s)
Any Ideas? Thanks in advance.