# XML Hyperlink with thumbnail slideshow

**URL:** https://forum.kirupa.com/t/xml-hyperlink-with-thumbnail-slideshow/207568
**Category:** flash
**Created:** [November 19, 2006, 8:57am UTC](https://forum.kirupa.com/t/xml-hyperlink-with-thumbnail-slideshow/207568 "2006-11-19T08:57:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![setsta](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@setsta](https://forum.kirupa.com/u/setsta)
#### Post date: [November 19, 2006, 8:57am UTC](https://forum.kirupa.com/t/xml-hyperlink-with-thumbnail-slideshow/207568/1 "2006-11-19T08:57:59Z")

</div>

Hi, I am new to both Flash and Kirupa. As an introduction to flash I decided to complete the thumbnail slideshow tutorial and all is good. I am now trying to have an XML node displau as a hyperlinkon the slide show.

I have searched these forums and tried all solution but with no luck. I keep receiving “NULL” as my link. Here is an example of the XML code;

[COLOR=Blue]\<?xml version=“1.0” encoding=“utf-8” standalone=“yes”?\>  
\<images\>  
\<pic\>  
\<image\>\portfolio\_images\abs\_accred\_lge.jpg\</image\>  
\<caption\>ABS\</caption\>  
\<thumbnail\>\portfolio\_thumbs\abs\_accred\_thumb.jpg\</thumbnail\>  
\<details\>Details go here.\</details\>  
\<features1\>Feature 1\</features1\>  
\<features2\>Feature 2\</features2\>  
\<features3\>Feature 3\</features3\>  
\<link\>\<a href=‘[http://www.google.com](http://www.google.com)’\>Click here\</a\>\</link\>  
\</pic\>  
[/COLOR][COLOR=Blue]\</images\>  
[COLOR=Black]  
and here is the Flash Action Script;

[COLOR=Blue]function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
image = [];  
description = [];  
thumbnails = [];  
details = [];  
features\_1 = []; features\_2 = []; features\_3 = [];  
link = [];

```
    total = xmlNode.childNodes.length;
    for (i=0; i&lt;total; i++) {
        image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
        description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
        thumbnails* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
        details* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
        features_1* = xmlNode.childNodes*.childNodes[4].firstChild.nodeValue;
        features_2* = xmlNode.childNodes*.childNodes[5].firstChild.nodeValue;
        features_3* = xmlNode.childNodes*.childNodes[6].firstChild.nodeValue;
        link* = xmlNode.childNodes*.childNodes[7].firstChild.nodeValue;
        thumbnails_fn(i);
    }
    firstImage();
} else {
    content = "file not loaded!";
}

```

}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“images.xml”);  
/////////////////////////////////////

Key.addListener(listen);  
previous\_btn.onRelease = function() {  
prevImage();  
};  
next\_btn.onRelease = function() {  
nextImage();  
};

/////////////////////////////////////  
p = 0;  
this.onEnterFrame = function() {  
filesize = picture.getBytesTotal();  
loaded = picture.getBytesLoaded();  
preloader.\_visible = true;  
if (loaded != filesize) {  
preloader.preload\_bar.\_xscale = 100\*loaded/filesize;  
} else {  
preloader.\_visible = false;  
if (picture.\_alpha\<100) {  
picture.\_alpha += 10;  
}  
}  
};  
function nextImage() {  
if (p\<(total-1)) {  
p++;  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
desc\_txt.text = description[p];  
desc\_1.text = details[p];  
feature\_1.text = features\_1[p];  
feature\_2.text = features\_2[p];  
feature\_3.text = features\_3[p];  
visit\_link.text = link[p];

```
        myText.html = true;
        myText.selectable = false;
        myText.htmlText = link[p];
        
    }
}

```

}  
function prevImage() {  
if (p\>0) {  
p–;  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
desc\_txt.text = description[p];  
desc\_1.text = details[p];  
feature\_1.text = features\_1[p];  
feature\_2.text = features\_2[p];  
feature\_3.text = features\_3[p];  
visit\_link.text = link[p];  
}  
}  
function firstImage() {  
if (loaded == filesize) {  
picture.\_alpha = 0;  
picture.loadMovie(image[0], 1);  
desc\_txt.text = description[0];  
desc\_1.text = details[0];  
feature\_1.text = features\_1[0];  
feature\_2.text = features\_2[0];  
feature\_3.text = features\_3[0];  
visit\_link.text = link[0];  
}  
}

rowLength = 50;  
rowValue = 0;  
colLength = 50;  
colValue = 0;

function thumbnails\_fn(k) {

```
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) 
    {
        col = colLength * colValue;
        target_mc._x = col;
        target_mc._y = row;
        
        colValue++
        
        if (colValue == 4){
            colValue = 0;
            rowValue++
            row = rowLength * rowValue;
        }
        
        target_mc.pictureValue = k;
        
        
        target_mc.onRelease = function() 
            {
                p = this.pictureValue-1;
                nextImage();
            };
            

        target_mc.onRollOver = function() 
        {
            this._alpha = 50;
            this._xscale = 100;

        };
        target_mc.onRollOut = function() 
        {
            this._alpha = 100;
        };
    };
    
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);

```

}  
[/COLOR]

As you can see I have tried to work with the test variable [/COLOR][/COLOR][COLOR=Blue][COLOR=Black][COLOR=Blue]myText [COLOR=Black]but with no luck.

I have also tried using CDATA in the XML but still to no avail.

If anyone can point me in the right direction then it will be greatly appreciated.

[/COLOR][/COLOR][/COLOR][/COLOR]
