[F8] can't manage thumbs!

Hi, everybody:

Just want to put the thumbnails in a movie clip, any ideas…
what am I doing wrong?
Not any thumbs are appearing, there is a mc on stage, there are images and thumbs, there is a xml_file…

var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(ok) {
	if (ok) {
		parafrasis(gallery_xml);
	} else {
		trace("error");
	}
};
gallery_xml.load("images.xml");
function parafrasis(gallery_xml) {
	var galleryPictures = gallery_xml.firstChild.childNodes;
	totalPictures = galleryPictures.length;
	for (var i = 0; i<totalPictures; i++) {
		var currentPicture = galleryPictures*;
		var holder = thumbnails.createEmptyMovieClip("holding"+i, i);
		col = 8;
		row = 6;
		wi = 100;
		hi = 80;
		cuenta = 0;
		for (j=0; j<col; j++) {
			for (k=0; k<row; k++) {
				this["holding"+cuenta]._x = 20+wid*j;
				this["holding"+cuenta]._y = 20+hi*k;
				cuenta++;
			}
		}
		inner = holder.createEmptyMovieClip("thumbnail_image", 0);
		inner.loadMovie(currentPicture.attributes.thumbs);
		holder.image = currentPicture.attributes.images;
		holder.onRelease = function() {
			images.loadMovie(this.image);
		};
	}
}

Thanks in advanced!

Use ActionScript tags:) makes it easier to read ( [ as ] & [ /as ] without the spaces)

var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(ok) {
	if (ok) {
		parafrasis(gallery_xml);
	} else {
		trace("error");
	}
};
gallery_xml.load("images.xml");
function parafrasis(gallery_xml) {
	var galleryPictures = gallery_xml.firstChild.childNodes;
	totalPictures = galleryPictures.length;
	for (var i = 0; i<totalPictures; i++) {
		var currentPicture = galleryPictures*;
		var holder = thumbnails.createEmptyMovieClip("holding"+i, i);
		col = 8;
		row = 6;
		wi = 100;
		hi = 80;
		cuenta = 0;
		for (j=0; j<col; j++) {
			for (k=0; k<row; k++) {
				this["holding"+cuenta]._x = 20+wid*j;
				this["holding"+cuenta]._y = 20+hi*k;
				cuenta++;
			}
		}
		inner = holder.createEmptyMovieClip("thumbnail_image", 0);
		inner.loadMovie(currentPicture.attributes.thumbs);
		holder.image = currentPicture.attributes.images;
		holder.onRelease = function() {
			images.loadMovie(this.image);
		};
	}
}

thanks for the advice, any other advice…please?

:q:

i was reading through it and trying to figure out what the issue is, but i started to get lost at about this point:

inner.loadMovie(currentPicture.attributes.thumbs);
holder.image = currentPicture.attributes.images;

Is “attributes” a node in your XML?

the attributes property is an associative array of the specified elements attributes… for instance…


<shape>
   <rectangle width="50" height="100" />
</shape>

Where width and height can be accessed…

firstNode.childNodes[0].attributes.width

or height respectively…

_Michael

Unless dec’s xml is implemented wrong

Unless dec’s xml is implemented wrong

The xml is something like this:


<images>
    <picture	    title		= "01"
			    thumb	= "thumbs/01.jpg"
			    image	= "images/01.jpg" />

The script works fine, but only for a row, that is why I implemented the other two loops the j and the k, and row and col, because I wanted a grid…but still don’t know what the problem is ::(:

var col = 8;
var wi = 100;
var hi = 80;
function parafrasis(gallery_xml) {
	var galleryPictures = gallery_xml.firstChild.childNodes;
	totalPictures = galleryPictures.length;
	for (var i = 0; i<totalPictures; i++) {
		var currentPicture = galleryPictures*;
		var holder = thumbnails.createEmptyMovieClip("holding"+i, i);
		holder._x = 20+(i%col)*wi;
		holder._y = 20+Math.floor(i/col)*hi;
		inner = holder.createEmptyMovieClip("thumbnail_image", 0);
		inner.loadMovie(currentPicture.attributes.thumbs);
		holder.image = currentPicture.attributes.images;
		holder.onRelease = function() {
			images.loadMovie(this.image);
		};
	}
}

?

scotty(-:

Thank you scotty, but I can’t still manage ::(:
this is my file…

does anybody know a tutorial for dummies?, it is hard for me learning xml, this one I’m using I can understand…

any kind of help is welcome!

:book:

What isn’t working for you, cause for me it works…

scotty(-:

could you please take a look at my_gallery zip…please!(it is two posts above)

is it the file or I’m a fool!

thank you :puzzle:

:lol: I did…

scotty(-:

I can’t see the thumbs, all I can see is black, I downloaded my own gallery and it still not working!

Check the names and paths to your pictures.

scotty(-: