I have used the Completed Modified Slideshow by ncc50446 who also helped me a lot.
Everything works fine but…
Now I would like to change the view of the thumbnails. I would like to show 6 thumbnails at the time. So when you click at next 6 new thumbnails will shows up.
I have no idea how I can change the code to this function. Anyone?
This is the code right now:
System.useCodepage = true;
cliparray = [];
delay = 10000;
var slide = 1;
var delay_slide;
var current;
var k = 0;
xmlData.load("images.php");
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
link = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
link* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
thumbnails* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);
}
id = setInterval(preloadPic, 100);
//firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.php");
/////////////////////////////////////
function preloadPic() {
clearInterval(id);
var con = picture.duplicateMovieClip("con"+k, 9984+k);
con.loadMovie(image[p]);
preloader._visible = 0;
preloader.swapDepths(con.getDepth()+3);
con._alpha = 0;
var temp = _root.createEmptyMovieClip("temp"+k, 99+k);
k++;
temp.onEnterFrame = function() {
var total = con.getBytesTotal();
var loaded = con.getBytesLoaded();
percent = Math.round(loaded/total*100);
preloader.preload_bar._xscale = percent;
desc_txt.text = description[p];
picture_num();
if (con._width) {
//con._width=300;
//con._height=200;
//con.onRelease = function() {
//getURL(link[p], "_blank");
//};
preloader._visible = 0;
con.onEnterFrame = fadeIn;
/*if (slide) {
id = setInterval(nextImage, 3000);
}
*/
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;
}
};
/////////////////////////////////////
p = 0;
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() {
slide = 0;
prevImage();
};
next_btn.onRelease = function() {
slide = 0;
nextImage();
};
/////////////////////////////////////
function nextImage() {
p<total-1 ? p++ : p=0;
desc_txt.text = description[p];
picture_num();
preloadPic();
}
function prevImage() {
p>0 ? p-- : p=total-1;
desc_txt.text = description[p];
picture_num();
preloadPic();
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
preloadPic();
slideshow();
}
}
pause_btn.onRelease = function(){
slide = 0;
clearInterval(myInterval);
}
play_btn.onRelease = function(){
myInterval = setInterval(pause_slideshow, delay);
slide = 1;
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 2;
var tot = 0;
//SLIDER RIGHT-LEFT
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if (_root._xmouse>=(hit_right._x+200)) {
for (var obj in cliparray) {
cliparray[obj]._x -= scroll_speed;
}
if (cliparray[0]._x<-cliparray[0]._width) {
cliparray[0]._x = cliparray[cliparray.length-1]._x+cliparray[cliparray.length-1]._width+5;
var j = cliparray.splice(0, 1);
cliparray = cliparray.concat(j);
}
} else if (_root._xmouse<=(hit_left._x+220)) {
for (var obj in cliparray) {
cliparray[obj]._x += scroll_speed;
}
if (cliparray[cliparray.length-1]._x>hit_right._x) {
cliparray[cliparray.length-1]._x = cliparray[0]._x-(cliparray[cliparray.length-1]._width+5);
var j = cliparray.splice(cliparray.length-1, 1);
cliparray = j.concat(cliparray);
}
}
}
};
function thumbnails_fn(k) {
var yy = thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
cliparray.push(yy);
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._width =100;
target_mc._height = 67;
target_mc._x = 5+(target_mc._width+5)*k;
target_mc.pictureValue = k;
tot += target_mc._x;
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);
}
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
//firstImage();
} else if (p == total) {
gotoAndPlay("credits", 1);
} else {
nextImage();
}
}
createEmptyMovieClip("paper", -200);
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
// my changes start //////////////////////////
trace("myInterval="+myInterval);
// here's your code (stringy)
for (var i = 1; i<100; i++) {
clearInterval(i);
}
clearInterval(myInterval);
delete myInterval;
// my changes end //////////////////////////
if (p == (total-1)) {
p = 0;
firstImage();
preloadPic();
} else {
nextImage();
preloadPic();
}
}
}
preloadPic();