hello all
I have this piece of code that loops through a set of photo’s but now I want it to be able to fade in and out while looping. I have pretty much no knowledge of actionscripting so I was hoping someone could help me out here.
Here’s the code:
//Set amount of time to hold each image onscreen
var inSeconds:Number = 7;
var xmlBanners:XML = new XML();
xmlBanners.ignoreWhite = true;
xmlBanners.onLoad = function(success) {
if (success) {
parseXML(xmlBanners);
}
};
xmlBanners.load("_lib/file.xml");
function parseXML(banners_XML) {
var bannerNum:Number = 0;
var xnRoot:XMLNode = banners_XML.firstChild;
var xnBanner:XMLNode;
xnBanner = xnRoot.childNodes[bannerNum];
myFile = xnBanner.firstChild.firstChild;
myURL = xnBanner.lastChild.firstChild;
this.onEnterFrame = function() {
//This creates the first clip without delay
this.createEmptyMovieClip("my_mc", this.getNextHighestDepth());
var movLoad:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myListener.onLoadInit = function(thisMc:MovieClip) {
thisMc.onRelease = function() {
getURL(myURL);
};
};
movLoad.addListener(myListener);
movLoad.loadClip("_lib/photos/"+myFile, this.my_mc);
delete this.onEnterFrame;
};
//After that, they are on a timed change
this.getNewPic = function() {
var maxBanners:Number = xnRoot.childNodes.length;
if (bannerNum == maxBanners-1) {
bannerNum = 0;
}
else {
bannerNum++;
}
xnBanner = xnRoot.childNodes[bannerNum];
myFile = xnBanner.firstChild.firstChild;
myURL = xnBanner.lastChild.firstChild;
//
this.createEmptyMovieClip("my_mc", this.getNextHighestDepth());
var movLoad:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myListener.onLoadInit = function(thisMc:MovieClip) {
thisMc.onRelease = function() {
getURL(myURL);
};
};
movLoad.addListener(myListener);
movLoad.loadClip("_lib/photos/"+myFile, this.my_mc);
};
var myInt = setInterval(this, "getNewPic", (inSeconds*1000));
}