# XML loaded images with specified links

**URL:** <https://forum.kirupa.com/t/xml-loaded-images-with-specified-links/171629>\
**Category:** flash\
**Created:** [December 6, 2005, 11:09pm UTC](https://forum.kirupa.com/t/xml-loaded-images-with-specified-links/171629 "2005-12-06T23:09:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrAnDX105](https://avatars.discourse-cdn.com/v4/letter/b/85e7bf/32.png) [@BrAnDX105](https://forum.kirupa.com/u/BrAnDX105)\
**Post date:** [December 6, 2005, 11:09pm UTC](https://forum.kirupa.com/t/xml-loaded-images-with-specified-links/171629/1 "2005-12-06T23:09:58Z")

</div>

If anyone could help me out it would be much appreciated. I have menu system built loading XML, when you click a menu item it loads up a seperate XML file for a picture gallery. When you click on a thumbnail it shows a preview image of the thumbnail, and I want it so when you click the preview image it will open upto a new browser and go directly to an image i specify in my XML.

Here is the code I wrote:

function createGallery(gallery\_xml)  
{  
var galleryPictures = gallery\_xml.firstChild.childNodes;

imageGallery = mainMenu.attachMovie(“gallery\_mc”,“imageGallery\_mc”, 300); //attaches dynamic text box for preview description  
imageGallery\_image = mainMenu.attachMovie(“galleryimage\_mc”,“imageGallery\_image\_mc”,302);  
imageGallery\_image.createEmptyMovieClip(“image\_container”,400);  
imageGallery.\_x = 280; //attaches and sets image gallery  
imageGallery.\_y = 230; // at this X and Y

thumb\_holder = menuMovieClip.attachMovie(“gallerythumb\_mc”, “gallery\_holder”, 251); //attaches thumbnail skeletons

imageGallery\_image.\_x = 275;  
imageGallery\_image.\_y = 180;

```
for (var i = 0; i &lt; galleryPictures.length; i++){
    var currPicture = galleryPictures*;
    
    var currThumb_mc = thumb_holder.attachMovie("thumbgallery_mc","thumbs"+thumb_count,270+thumb_count);
    
    currThumb_mc.createEmptyMovieClip("thumb_container",280+thumb_count); currThumb_mc.thumb_container.loadMovie(currPicture.attributes.thumb);

```

…

```
    currThumb_mc.image = currPicture.attributes.image;
    currThumb_mc.description = currPicture.attributes.description;
    imageGallery_image_mc.link = currPicture.attributes.link;

currThumb_mc.onRollOver = currThumb_mc.onDragOver = function () {
this.onEnterFrame = function() {
     if (this.thumbgallery_bg._alpha &lt; 100) {
          this.thumbgallery_bg._alpha += 10;
            }
    }

```

}  
currThumb\_mc.onRollOut = currThumb\_mc.onDragOut = function () {  
this.onEnterFrame = function() {  
if (this.thumbgallery\_bg.\_alpha \> 0) {  
this.thumbgallery\_bg.\_alpha -= 13;  
}  
}  
}

```
    currThumb_mc.onRelease = function(){
        imageGallery_image.image_container.loadMovie(this.image);
        imageGallery.gallery_txt.text = this.description;
        imageGallery_image.image_container._y = -80;
        //imageGallery_image._x = 280;
        //imageGallery_image._visible = false;

    }
    **[color=Red] imageGallery_image.onMouseUp = function(){
            
            getURL(imageGallery_image_mc.link, "_blank");
    
                                          
}

```

}

[color=Black]The red part is the code I’m trying to use. I tryed many variations on the code I have there, including changing the actual function name, and the link name inside of the getURL. Each thumbnail inside of the XML file has a specified “link” attribute, which I want my code to load when you click on the preview image that comes up. I know this is a simple problem, I just can’t seem to figure it out and it’s been driving me nuts! :tb:[/color]  
[/color]\*\*
