# Thumbnails and XML

**URL:** <https://forum.kirupa.com/t/thumbnails-and-xml/204281>\
**Category:** Uncategorized\
**Created:** [October 18, 2006, 3:24pm UTC](https://forum.kirupa.com/t/thumbnails-and-xml/204281 "2006-10-18T15:24:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Almonimus](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@Almonimus](https://forum.kirupa.com/u/Almonimus)\
**Post date:** [October 18, 2006, 3:24pm UTC](https://forum.kirupa.com/t/thumbnails-and-xml/204281/1 "2006-10-18T15:24:07Z")

</div>

I’m trying creating thumbnails using XML and being helped by this [tutorial](http://www.tutorio.com/tutorial/simple-flash-xml-photogallery/1). I didn’t copy the code exactly as they did because my system is more complicated (having different categories, and those are thumbs for projects and not for 1 file each, and a file can be mp3, jpg etc. so I have a special MC that analiases it and then run it appropriately), so this is what I got, yet it doesn’t work and it seems it doesn’t manage to create **thumbHolder**.

```auto
import com.xfactorstudio.xml.xpath.*;
import mx.utils.Delegate; //helps to manage scope issues within callback functions

var thumbSpace:Number = 16;
var edge:Number = (Stage.width - 800 - 9 *thumbSpace)/2 ;
var prjName:Array;
var prjThumb:Array;
var prjInfo:Array;
var maxProjects:Number;

mainXML = new XML();
mainXML.ignoreWhite = true;
mainXML.load("Database.xml");
mainXML.onLoad = function() {
    prjName = XPath.selectNodes(mainXML, ("/Portfolio/" + category + "/Project/@Name"));
    prjThumb = XPath.selectNodes(mainXML, ("/Portfolio/" + category + "/Project/@Thumbnail"));
    prjInfo = XPath.selectNodes(mainXML, ("/Portfolio/" + category + "/Project/@Information"));
    maxProjects = prjName.length;
    for (i=0; i<maxProjects; i++) {
        this.thumbHolder = this.createEmptyMovieClip("thumbnail"+i, i);
        this.thumbHolder._x = edge + 80 * (i+1) + thumbSpace * i;
        this.thumbHolder._y = Stage.height - 80 - thumbSpace;
        trace (this.thumbHolder._x + " " + this.thumbHolder._y);
        this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
        this.thumbLoader.loadMovie("projects/" + category + "/" + prjThumb*);
        this.thumbHolder.onRelease = function() {
            trace ("bap");
        };
    };
}

stop();

```

[FONT=Courier New] [/FONT]By the way, this code is in the Thumbnails’ movieclip and not in the root.

---

<div class="post-metadata">

**Author:** ![Almonimus](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@Almonimus](https://forum.kirupa.com/u/Almonimus)\
**Post date:** [October 23, 2006, 8:02pm UTC](https://forum.kirupa.com/t/thumbnails-and-xml/204281/2 "2006-10-23T20:02:24Z")

</div>

Someone please?
