# AS3 dynamic XML gallery help

**URL:** https://forum.kirupa.com/t/as3-dynamic-xml-gallery-help/309685
**Category:** flash
**Created:** [May 21, 2010, 10:16am UTC](https://forum.kirupa.com/t/as3-dynamic-xml-gallery-help/309685 "2010-05-21T10:16:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tomto](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@tomto](https://forum.kirupa.com/u/tomto)
#### Post date: [May 21, 2010, 10:16am UTC](https://forum.kirupa.com/t/as3-dynamic-xml-gallery-help/309685/1 "2010-05-21T10:16:03Z")

</div>

Hi All,

I’m currently trying to create a (what I thought would be) relatively simple XML gallery in AS3.

What I currently have is my thumbnails being brought in through the XML and distributed horizontally at the bottom of my stage - great.

Now, my XML also contains a URL which links to a video clip which I would like to be loaded into a video area when each of the relevent thumbnails is clicked.

How can I go about achieving this? I’ve come to a bit of a stuck as I can’t correlate how to get the URL passed through to the function I have onPress of my enlarging button. In AS2 I would do this in a global variable however i’m aware this isn’t available in 3.

Below is my code that is parsing the XML and generating the thumbnails at the bottom of the stage.

```auto

function ParseDVDs(DVDs:XML):void {
    trace("XML Output");
    trace("------------------------");
        
    var coverList:XMLList = DVDs.product.coverimage.text();
    for each (var coverElement:XML in coverList) {
    //trace(coverElement);
    
    rad = rad + 100;

    var newThumb:Thumb = new Thumb();
    this.addChild(newThumb);
    
    newThumb.x = rad;
    newThumb.y = 317;

    var myLoader:Loader = new Loader()
    var url:URLRequest = new URLRequest(coverElement);
    myLoader.load(url);
    newThumb.holder.addChild(myLoader);

    }
}

```

Any help with this would be very much appreciated.  
Thanks
