# Xml Portfolio

**URL:** <https://forum.kirupa.com/t/xml-portfolio/125172>\
**Category:** Uncategorized\
**Created:** [October 11, 2004, 7:25am UTC](https://forum.kirupa.com/t/xml-portfolio/125172 "2004-10-11T07:25:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![p\_stevens](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@p\_stevens](https://forum.kirupa.com/u/p_stevens)\
**Post date:** [October 11, 2004, 7:25am UTC](https://forum.kirupa.com/t/xml-portfolio/125172/1 "2004-10-11T07:25:20Z")

</div>

Hey all, i made a portfolio whit xml, and it has all gone well until now.

I got some different titles etc. Well just have a look :  
[http://www.intermediamakers.nl//test/Portfolio/Portfolio.swf](http://www.intermediamakers.nl//test/Portfolio/Portfolio.swf)

As you can seeif you switch between the titles, the thumbs start where the last one from the title before, and the last thumb he keeps cloning untill he is at the last thumb of the last image (detailhandel)

so i don’t know what i did wrong, it has to start at the first one, and it doesn’t need to clone…

Here is the action script

[xml]  
var thumb\_spacingx = 98;  
var thumb\_spacingy = 67;  
var thumb\_count = 0;  
var rowcount = 0;  
var rowcounter = 1;  
var max = 4 \* rowcounter;  
var rowYcount = 1

function GeneratePortfolio(portfolio\_xml){  
var portfolioPictures = portfolio\_xml.firstChild.childNodes;  
for (var i = 0; i \< portfolioPictures.length; i++){  
if (portfolioPictures\*.attributes.type == “auto”)

var currentPicture = portfolioPictures\*;

var currentThumb\_mc = menu\_mc.createEmptyMovieClip(“thumbnail\_mc”+i,i);

currentThumb\_mc.\_x = thumb\_count \* thumb\_spacingx;  
thumb\_count++;  
currentThumb\_mc.createEmptyMovieClip(“thumb\_container”,0);  
currentThumb\_mc.thumb\_container.loadMovie(currentPicture.attributes.thumb);

if ( rowcount == 3 ){  
rowcount = rowcount - 3  
rowYcount++;}

if ( thumb\_count \>= max ){  
currentThumb\_mc.\_x = rowcount \* thumb\_spacingx;  
rowcount++;  
currentThumb\_mc.\_y = rowYcount \* thumb\_spacingy;}

currentThumb\_mc.title = currentPicture.attributes.title;  
currentThumb\_mc.url = currentPicture.attributes.url;  
currentThumb\_mc.image = currentPicture.attributes.image;  
currentThumb\_mc.description = currentPicture.attributes.description;

currentThumb\_mc.onRollOver = currentThumb\_mc.onDragOver = function(){  
info\_txt.text = this.title;

}  
currentThumb\_mc.onRollOut = currentThumb\_mc.onDragOut = function(){  
info\_txt.text = “”;  
}  
currentThumb\_mc.onRelease = function(){  
image\_mc.loadMovie(this.image);  
url\_txt.htmlText = “\<a href=’” + this.url + “’ target=’\_blank’\>” + this.description + “\</a\>”;  
}  
}  
}

var portfolio\_xml = new XML();  
portfolio\_xml.ignoreWhite = true;  
portfolio\_xml.onLoad = function(success){  
if (success) GeneratePortfolio(this);  
else trace(“Error loading XML file”);  
}  
portfolio\_xml.load(“portfolio.xml”);

[/xml]

Can any one help me?
