# How to reorgnize xml thumbnail ? right 2 left

**URL:** https://forum.kirupa.com/t/how-to-reorgnize-xml-thumbnail-right-2-left/216108
**Category:** Uncategorized
**Created:** [February 13, 2007, 8:43pm UTC](https://forum.kirupa.com/t/how-to-reorgnize-xml-thumbnail-right-2-left/216108 "2007-02-13T20:43:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![namelesspace](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@namelesspace](https://forum.kirupa.com/u/namelesspace)
#### Post date: [February 13, 2007, 8:43pm UTC](https://forum.kirupa.com/t/how-to-reorgnize-xml-thumbnail-right-2-left/216108/1 "2007-02-13T20:43:13Z")

</div>

this is probably very simple but i just can’t work it out…  
i took this script from one of the forum members, it works great and i was able to adjust many things (as space, scale and so on).

the thumbnails are 3 columns and 5 rows but the start from left to right which does not fit my design…how can i turn thing around ?

also can i fix the spacing separately for the columns and the rows ? because here it is fixed for both…

here is the script:

function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
image = [];  
description = [];  
thumbnails = [];  
\_global.total = xmlNode.childNodes.length;  
for (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;  
thumbnailer(i);  
}  
firstImage();  
} else {  
trace(“file not loaded!”);  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad =loadXML;  
xmlData.load(“images.xml”);

/////////Load First Image Function///////////////////////////////////////////////

function firstImage() {  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[0], 1);  
desc\_txt.text = description[0];  
}  
}

/////////Image Preloader Function//////////////////////////////////////////////////////

p = 0;  
this.onEnterFrame = function() {  
filesize = picture.getBytesTotal();  
loaded = picture.getBytesLoaded();  
preloader.\_visible = true;  
if (loaded != filesize) {  
preloader.preload\_bar.\_xscale = 100\*loaded/filesize;  
} else {  
preloader.\_visible = false;  
if (picture.\_alpha\<100) {  
picture.\_alpha += 10;  
}  
}  
};

//////////Load clicked thumbnail Image Function////////////////////////////////////////////////

function callImage() {  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
desc\_txt.text = description[p];  
}  
}

//////////Thumbnail maker///////////////////////////////

function thumbnailer(k){  
loaded\_counter=0;  
total\_thumbs = \_global.total;  
var container = thumbnail\_mc.createEmptyMovieClip(“th”+k,thumbnail\_mc.getNextHighestDepth());  
container.\_visible=false;  
container.\_alpha=0;  
var image = container.createEmptyMovieClip(“img”, container.getNextHighestDepth());  
tlistener = new Object();  
tlistener.onLoadInit = function(target\_mc) {  
target\_mc.pictureValue = k;  
target\_mc.onRelease = function() {  
p = this.pictureValue;  
callImage();  
};  
target\_mc.onRollOver = function() {  
this.\_alpha = 50;  
};  
target\_mc.onRollOut = function() {  
this.\_alpha = 100;  
};  
loaded\_counter++;  
counting\_txt = loaded\_counter;  
if(loaded\_counter==total\_thumbs){  
grid\_maker\_01();  
}  
};  
image\_mcl = new MovieClipLoader();  
image\_mcl.addListener(tlistener);  
image\_mcl.loadClip(thumbnails[k], “thumbnail\_mc.th”+k+".img");  
}

///////////Layout Functions/////////////////////////////////////////////////////////////////////

MovieClip.prototype.grid\_maker\_01=function(f){  
num=0;  
col=3;  
row=5;  
scale=145;  
space=6;  
for (j=0;j\<row;j++){  
for (l=0;l\<col;l++){  
if(num\<\_global.total){  
with(eval(“this.thumbnail\_mc.th”+num)){  
\_x=((\_width+space)\*scale/100)\*l;  
\_y=((\_height+space)\*scale/100)\*j;  
\_xscale=\_yscale=scale;  
\_visible=true;  
}  
num++;  
}  
}  
}  
this.cascader();  
}

//////////////////////////////////////////////////////////////////////////////////

MovieClip.prototype.cascader=function(){  
inter=300;  
c=0;  
delayed\_fade=function(){  
if (c\<\_global.total){  
with(eval(“this.thumbnail\_mc.th”+c)){  
fadein();  
}  
c++;  
}else{  
main\_menu.boton\_reset.\_visible=true;  
clearInterval(delay);  
}  
}  
delay=setInterval(delayed\_fade,inter);  
}

///////////////////////////////////////////////////////////////////////////////

MovieClip.prototype.fadein=function(){  
this.onEnterFrame=function(){  
if (this.\_alpha\<100){  
this.\_alpha=this.\_alpha+5;  
}else{  
this.\_alpha=100;  
delete this.onEnterFrame;  
}  
}  
}

///////////////////////////////////////////////////////////////////////////////////////

thanx guys
