that's done, whooot
No really that worked out pretty well, but maybe you can help me with something different, I have my finished flash scrip/ .swf but at the end of the cycle it generates an error. This error sais that flash needs to load something that isn't defined, wich is correct because after the fourth pic there isn't any other....still flash believes there is.
Now I can's find the answer/ problem on this one, so it would be great if you could check my code for me......
this is the code loading the XML doc into flash
Code:
stop();
//XML////////////////////////////////////////////
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
dia = [];
beschrijving = [];
timer = [];
xwidth = [];
yheight = [];
_global.total = xmlNode.childNodes.length;
for (i=0; i<_global.total; i++) {
dia[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
beschrijving[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
timer[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
xwidth[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
yheight[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue;
}
gotoAndPlay(2);
} else {}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("RWE slideshow.xml");
//var////////////////////////////////////////////
p = 0;
this is the code displaying the images/ switching between them
Code:
stop();
//variables//////////////////////////////////////
t = timer[p]*1000;
//preloader//////////////////////////////////////
loaded = Math.round(_root.getBytesLoaded());
filesize = Math.round(_root.getBytesTotal());
total_percent = (loaded/filesize)*100;
_root.loaded_txt = Math.round(total_percent);
if (loaded === filesize) {
preloader._visible = false;
preloader_txt._visible = false;
beschrijving_mc._visible = true;
beschrijving_txt._visible = true;
preloader_bg._visible = false;
if (beschrijving_logo._alpha<90) {
beschrijving_logo._alpha += 10;
}
ID = setInterval(function () {
gotoAndPlay(3);
}, t);
slide();
} else {
preloader._visible = true;
preloader_txt._visible = true;
beschrijving_mc._visible = false;
beschrijving_txt._visible = false;
if (beschrijving_logo._alpha>0) {
beschrijving_logo._alpha -= 10;
}
reloader_bg._visible = true;
}
//image switching////////////////////////////////////
mc_x = mc._x;
mc_y = mc._y;
mc_width = mc._xscale;
mc_height = mc._yscale;
function slide() {
if (loaded_bytes == loaded_total) {
mc.loadMovie(dia[p]);
beschrijving_text = (beschrijving[p]);
mc_x = mc._x;
mc_y = mc._y;
mc_width = xwidth[p]*(mc._xscale/100);
mc_height = yheight[p]*(mc._yscale/100);
scale();
if (p !== _global.total) {
p == p++;
} else {
p = 0;
}
}
}
function scale() {
//variables/////////////////////////////////////
total_width = 550;
total_height = 400;
mc_yscale = mc._yscale;
mc_xscale = mc._xscale;
mc_xw = mc_width/total_width;
mc_yh = mc_height/total_height;
//calculation///////////////////////////////////
mc._yscale = mc_yscale/mc_yh;
mc._xscale = mc_xscale/mc_xw;
locate();
}
function locate() {
mc_width = xwidth[p]*(mc._xscale/100);
mc_height = yheight[p]*(mc._yscale/100);
mc._x = mc_x-(mc_width/2);
mc._y = mc_y-(mc_height/2);
}
then there is a bit of code here and there but that has nothing to do with the problem......(Oh and the interval gets cleared at the end of every cycle...)