hi i am trying to a XML Photo Gallery using Kirupa’s code as bellwo
This code Contain fadein fadeout effects(alpha Down,UP) for images . But i want to attach a MC as a Mask . That MC has a Tweened box zoom in animation. How to attach that MC as a Mask. and also i nedd this effects applies (MC effct) to preloder also. Please help me
http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm
Kirupa’s Code.
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = “file not loaded!”;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“1_gallery.xml”);
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
prevBtn.onRelease = function() {
prevImage();
};
nextBtn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = pics.getBytesTotal();
loaded = pics.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (pics._alpha<100) {
pics._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
pics._alpha = 0;
pics.loadMovie(image[p], 1);
desc_txt.text = description[p];
pics_num();
}
}
}
function prevImage() {
if (p>0) {
p–;
pics._alpha = 0;
pics.loadMovie(image[p], 1);
desc_txt.text = description[p];
pics_num();
}
}
function firstImage() {
if (loaded == filesize) {
pics._alpha = 0;
pics.loadMovie(image[0], 1);
desc_txt.text = description[0];
pics_num();
}
}
function pics_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}