# Making XML thumbnails scrollable

**URL:** <https://forum.kirupa.com/t/making-xml-thumbnails-scrollable/239436>\
**Category:** flash\
**Created:** [September 21, 2007, 4:28pm UTC](https://forum.kirupa.com/t/making-xml-thumbnails-scrollable/239436 "2007-09-21T16:28:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spastic](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@spastic](https://forum.kirupa.com/u/spastic)\
**Post date:** [September 21, 2007, 4:28pm UTC](https://forum.kirupa.com/t/making-xml-thumbnails-scrollable/239436/1 "2007-09-21T16:28:53Z")

</div>

Greetings

I have an XML gallery of thumbnail images that open URLs, and the thumbnails SHOULD be contained within a movie clip, which I want to be scrollable. Right now, the thumbnails just extend horizontally (I’ve attached the SWF and fla). Can anyone help me contain the thumbnails in a scrollable box?

Thanks!

Here’s the code I’m using:

```auto
var thumb_spacing = 40;

// load variables object to handle loading of text
var description_lv = new LoadVars();
description_lv.onData = function(raw_text){
	description_txt.text = raw_text;
}

function GeneratePortfolio(portfolio_xml){
	var portfolioPictures = portfolio_xml.firstChild.childNodes;
	for (var i = 0; i < portfolioPictures.length; i++){
		var currentPicture = portfolioPictures*;
		
		var currentThumb_mc = menu_mc.createEmptyMovieClip("thumbnail_mc"+i,i);
		currentThumb_mc._x = i * thumb_spacing;
		
		currentThumb_mc.createEmptyMovieClip("thumb_container",0);
		currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);
		
		currentThumb_mc.title = currentPicture.attributes.title;
		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(){
					getURL(this.image, "_blank");
		}
	}
}

// xml object for xml content (defines sources for selections)
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success){
	if (success) GeneratePortfolio(this);
	else trace("Error loading XML file"); // no success? trace error (wont be seen on web)
}
// load
portfolio_xml.load("portfolio.xml");
	
	

```
