les pongo el codigo que utlizo a ver si me pueden dar un mano es urgente por favor gracias.
xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image id="pic0.jpg" url = "index.htm"/>
<caption>Alergizina</caption>
</pic>
<pic>
<image id="pic1.jpg" url = "index.htm"/>
<caption>Alergizina</caption>
</pic>
<pic>
<image id="pic2.jpg" url = "index.htm"/>
<caption>Alergizina</caption>
</pic>
<pic>
<image id="pic3.jpg" url = "index.htm"/>
<caption>BB Nasal</caption>
</pic>
<pic>
<image id="pic4.jpg" url = "index.htm"/>
<caption>BB Nasal</caption>
</pic>
<pic>
<image id="pic5.jpg" url = "index.htm"/>
<caption>Cipropharma</caption>
</pic>
<pic>
<image id="pic6.jpg" url = "index.htm"/>
<caption>Cipropharma</caption>
</pic>
<pic>
<image id="pic7.jpg" url = "index.htm"/>
<caption>Cipropharma</caption>
</pic>
<pic>
<image id="pic8.jpg" url = "index.htm"/>
<caption>Doloir</caption>
</pic>
<pic>
<image id="pic9.jpg" url = "index.htm"/>
<caption>Doloir</caption>
</pic>
<pic>
<image id="pic10.jpg" url = "index.htm"/>
<caption>Doloir</caption>
</pic>
<pic>
<image id="pic11.jpg" url = "index.htm"/>
<caption>Dolomes</caption>
</pic>
<pic>
<image id="pic12.jpg" url = "index.htm"/>
<caption>Dolomes</caption>
</pic>
<pic>
sction script:
delay = 4000;
//-----------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].attributes.id;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
////////////////////////
////////////////
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
slideshow();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
slideshow();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
}
