Gallery thumbs in a grid… yes, once again!

Hi everybody!

I’ve been reading through the many tutorials and posts to create my own gallery based on an xml file.

Believe me I’ve learnt a lot, I didn’t know anything, now I can call images. at least!

I just want thumbs to be arranged in a grid, it must be a silly thing, but I’m done!

Could anybody take a look, I 'll appreciate very much your help.

my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(ok) {
if (ok) {
loop(my_xml);
} else {
trace(“error loading xml file”);
}
};
my_xml.load(“pictures.xml”);
function loop(my_xml) {
var portfolioPictures = my_xml.firstChild.childNodes;
nuclips = portfolioPictures.length;
for (var i = 0; i<nuclips; i++) {
var currentPicture = portfolioPictures*;
var holder = _root.createEmptyMovieClip(“holding”+i, i);
col = 10;
row = 8;
space = 3;
cuenta = 0;
for (k=0; k<col; k++) {
for (j=0; j<row; j++) {
holder._x = (i+space)*j;
holder._y = (i+space)*k;
cuenta++;
}
}
inner = holder.createEmptyMovieClip(“thumbnail_image”, 0);
inner.loadMovie(currentPicture.attributes.thumb);
holder.title = currentPicture.attributes.title;
holder.image = currentPicture.attributes.image;
holder.onRollOver = function() {
_root.texto.text = this.title;
};
holder.onRelease = function() {
pictureit.loadMovie(this.image);
};
}
}

Thanks in advanced. :*(
dec27

Something like

var col = 10;
var row = 8;
//wi is the thumbnail width + the space you want
var wi = 75;
//hi is the thumbnail height + the space you want
var hi = 75;
for (k=0; k<col; k++) {
	for (j=0; j<row; j++) {
		holder._x = wi*j;
		holder._y = hi*k;
	}
}

scotty(-:

I’m very sorry for not reply before.

Using the code I posted the images do appear, in cascade, but they appear.
I don’t know which is the problem, if I change the code. The images just don’t appear.
I think somehow I have to include my var i.

Let me know if I did something wrong. please.
Thank you, for taking the time!:sure:

my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(ok) {
if (ok) {
loop(my_xml);
} else {
trace(“error loading xml file”);
}
};
my_xml.load(“images.xml”);
function loop(my_xml) {
var portfolioPictures = my_xml.firstChild.childNodes;
nuclips = portfolioPictures.length;
for (var i = 0; i<nuclips; i++) {
var currentPicture = portfolioPictures*;
var holder = _root.createEmptyMovieClip(“holding”+i, i);
var col = 10;
var row = 8;
//wi is the thumbnail width + the space you want
var wi = 75;
//hi is the thumbnail height + the space you want
var hi = 75;
for (k=0; k<col; k++) {
for (j=0; j<row; j++) {
holder._x = wij;
holder._y = hi
k;
}
}
inner = holder.createEmptyMovieClip(“thumbnail_image”, 0);
inner.loadMovie(currentPicture.attributes.thumb);
holder.title = currentPicture.attributes.title;
holder.image = currentPicture.attributes.image;
holder.onRollOver = function() {
_root.texto.text = this.title;
};
holder.onRelease = function() {
_root.disappear(_root.images, 0);
pictureit.loadMovie(this.image);
};
}
}

sounds like a depth issue to me.

Could you explain better, please?

I managed to do it before, not with an xml, but it worked.

Which is the problem?:q:

col = 10;
row = 8;
wi = 30;
hi = 23;
cuenta = 0;
for (k=0; k<col; k++) {
for (j=0; j<row; j++) {
holder._x = wii;
holder._y = hi
k;
cuenta++;
}
}
This way it appears horizontally, what am I doing wrong?:frowning:

Well I found a solution.

This is it!

col = 6;
row = 5;
wi = 40;
hi = 50;
cuenta = 0;
for (x=0; x<col; x++) {
for (y=0; y<row; y++) {
this[“holding”+cuenta]._x = 100+wix;
this[“holding”+cuenta]._y = 150+hi
y;
cuenta++;
}
}

Thank you!:wink: