I am not very good in writing action script myself.
i want to make a gallery where the thumbnails and the main fotos are loaded through a xml file.
it should look like this: http://webdesign.jedidiah.nl/xmlphotogallery.html
when klicking on a thumbnail the main picture is loaded. the problem is that it covers the some of the thumbs. I would ike to be able to unload the main picture again so that all the thumbs are viewed again on clicking on the main picture.
could someone please help me with this. I have been trying to find a solution in many ways for some day but was not able to find any till now.
kind regards. see below the scirpit i used.
Jedi4ever :puzzle:
i used script i found in a tutorial on www. i cannot remmember the site, and adapted it:
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.load(“swsm.xml”);
myPhoto.onLoad = function(success) {
//portfolioTag = this.firstChild;
numimages = this.firstChild.childNodes.length;;
spacingx = 125;
this.thumbnails._width =125
this.thumbnails._height =93
spacingy =93;
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes*;
this.thumbHolder = thumbnails.createEmptyMovieClip(“thumbnail”+i, i);
this.thumbHolder._x = i*spacingx;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip(“thumbnail_image”, 0);
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
};
}
};
//===================================================================
myPhoto2 = new XML();
myPhoto2.ignoreWhite = true;
myPhoto2.load(“swsm2.xml”);
myPhoto2.onLoad = function(success) {
//portfolioTag = this.firstChild;
numimages2 = this.firstChild.childNodes.length;;
spacing2x = 125;
this.thumbnails2._width =125
this.thumbnails2._height =93
spacing2y =93;
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes*;
this.thumbHolder = thumbnails2.createEmptyMovieClip(“thumbnail”+i, i);
this.thumbHolder._x = i*spacing2x;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip(“thumbnail_image”, 0);
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
}
}
};
//=======================================================================
myPhoto3 = new XML();
myPhoto3.ignoreWhite = true;
myPhoto3.load(“swsm3.xml”);
myPhoto3.onLoad = function(success) {
//portfolioTag = this.firstChild;
numimages3 = this.firstChild.childNodes.length;;
spacing3x = 125;
this.thumbnails3._width =125
this.thumbnails3._height =93
spacing3y =93;
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes*;
this.thumbHolder = thumbnails3.createEmptyMovieClip(“thumbnail”+i, i);
this.thumbHolder._x = i*spacingx;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip(“thumbnail_image”, 0);
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
};
}
};
//============================================================================================
myPhoto4 = new XML();
myPhoto4.ignoreWhite = true;
myPhoto4.load(“swsm4.xml”);
myPhoto4.onLoad = function(success) {
//portfolioTag = this.firstChild;
numimages4 = this.firstChild.childNodes.length;;
spacing4x = 125;
this.thumbnails4._width =125
this.thumbnails4._height =93
spacing4y =93;
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes*;
this.thumbHolder = thumbnails4.createEmptyMovieClip(“thumbnail”+i, i);
this.thumbHolder._x = i*spacingx;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip(“thumbnail_image”, 0);
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
};
}
};
//============================================================================================
myPhoto5 = new XML();
myPhoto5.ignoreWhite = true;
myPhoto5.load(“swsm5.xml”);
myPhoto5.onLoad = function(success) {
//portfolioTag = this.firstChild;
numimages5 = this.firstChild.childNodes.length;;
spacing5x = 125;
this.thumbnails5._width =125
this.thumbnails5._height =93
spacing5y =93;
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes*;
this.thumbHolder = thumbnails5.createEmptyMovieClip(“thumbnail”+i, i);
this.thumbHolder._x = i*spacingx;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip(“thumbnail_image”, 0);
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
};
}
};