sera, avevo trattato qualcosa di simile tempo fa..
ora però il problema si sposta sulla dissolvenza dell'immagine caricata.. cioè vorrei che la prima immagine caricata e le due successive, per un totale di 3 apparissere sempre con _alpha da 0 a 100% per farmi capire melgio posto il codice che sto utilizzando!
codice:
images_xml = new XML();
images_xml.onLoad = startImageViewer;
images_xml.load("xml/images.xml");
images_xml.ignoreWhite = true;
function startImageViewer(success) {
if (success == true) {
rootNode = images_xml.firstChild;
totalImages = rootNode.childNodes.length;
firstImageNode = rootNode.firstChild;
currentImageNode = firstImageNode;
currentIndex = 1;
updateImage(firstImageNode, 200, 100);
}
}
function updateImage(newImageNode, wdt, hgt) {
imagePath = newImageNode.attributes.imgURL;
targetClip._alpha = 0;
a = setInterval(preload, 200, wdt, hgt);
targetClip.loadMovie(imagePath);
imageCount = "images " + currentIndex + " of " + totalImages;
}
next_btn.onRelease = function(){
nextImageNode = currentImageNode.nextSibling;
if (nextImageNode == null) {
break;
} else {
currentIndex++;
updateImage(nextImageNode, 200, 100);
currentImageNode = nextImageNode;
}
};
back_btn.onRelease = function() {
previousImageNode = currentImageNode.previousSibling;
if (previousImageNode == null) {
break;
} else {
currentIndex--;
currentImageNode = previousImageNode;
updateImage(previousImageNode, 200, 100);
}
};
function preload(wdt, hgt) {
car = targetClip.getBytesLoaded();
tot = targetClip.getBytesTotal();
perc = Math.round((car / tot) * 100);
imagestat.text = "Loading... " + perc + "%";
if (car == tot && targetClip._url != _root.url) {
targetClip._width = wdt;
targetClip._height = hgt;
clearInterval(a);
imagestat.text = "";
targetClip._alpha=100;
}
}
grazie a tutti, ciaoo