I keep ending up with more problems…I just noticed that when my slideshow is paused and you click on a thumbnail, it wont go to it…The next and previous still work, but not the thumbnails…how do I fix this? Hopefully this will be my last problem lol It is helping me learn flash though haha
var total;
var p = 0;
var current;
var k = 0;
//variables for slideshow
var slide = 1;
var delay_slide;
//this is the interval between the pics: 6 seconds
var interS = 3000;
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
link = [];
total = xmlNode.childNodes.length;
for (var i = 0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
thumbnails* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);
link* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
}
loadPic(p);
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("slide.xml");
/////////////////////////////////////
function loadPic(p) {
picture.loadMovie(image[p]);
picture._alpha = 0;
var temp = this.createEmptyMovieClip("tem", 9978);
temp.onEnterFrame = function() {
var filesize = picture.getBytesTotal();
var loaded = picture.getBytesLoaded();
preloader._visible = true;
preloader.preload_bar._xscale = Math.round((loaded/filesize)*100);
if (picture._width) {
picture._width =300;
picture._height = 200;
preloader._visible = false;
picture.fadeTo(100, 1.1);
desc_txt.text = description[p];
slideshow();
picture_num();
picture._alpha += 7;
if (picture._alpha>100) {
picture._alpha = 100;
picture.onRelease = function() {
getURL(link[p], "_blank");
};
//if the slideshow is running
if (slide) {
delay_slide = setInterval(showSlide, interS, total);
}
delete this.onEnterFrame;
}
}
};
}
MovieClip.prototype.fadeIn = function() {
if (this._alpha<100) {
current._alpha -= 10;
this._alpha += 10;
} else {
current._visible = 0;
current = this;
delete this.onEnterFrame;
}
};
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
previous_btn.onRelease();
} else if (Key.getCode() == Key.RIGHT) {
next_btn.onRelease();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
p>0 ? (p--, loadPic(p), slide=0) : null;
};
next_btn.onRelease = function() {
p<total-1 ? (p++, loadPic(p), slide=0) : null;
slideshow();
};
//function for the slideshow
function showSlide(total) {
//clear the interval (if there's a slideshow)
clearInterval(delay_slide);
p<total-1 ? (p++, loadPic(p), setButtons(p)) : (p=0, loadPic(p), setButtons(p));
}
slide_btn._alpha = 50;
slide_btn.enabled = 0;
slide_btn.onRelease = function() {
this._alpha = 50;
this.enabled = 0;
stop_btn._alpha = 100;
stop_btn.enabled = 1;
slide = 1;
showSlide(total);
};
stop_btn.onRelease = function() {
clearInterval(delay_slide);
slide = 0;
this._alpha = 50;
this.enabled = 0;
slide_btn._alpha = 100;
slide_btn.enabled = 1;
};
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._width =100;
target_mc._height = 67;
target_mc._x = hit_left._x+(target_mc._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
Is it also possible so that when the slideshow is running, that when you click on a thumbnail, it takes you there right away, and not once it loads the next slide.If thats more work, thats fine, I can figure it out later, just to be able to click on thumbnails when its paused.
Thanks for any help, and I will hopefully stop asking questions soon haha