# Linking troubles

**URL:** <https://forum.kirupa.com/t/linking-troubles/252392>\
**Category:** flash\
**Created:** [February 19, 2008, 7:13pm UTC](https://forum.kirupa.com/t/linking-troubles/252392 "2008-02-19T19:13:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Acadian](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Acadian](https://forum.kirupa.com/u/Acadian)\
**Post date:** [February 19, 2008, 7:13pm UTC](https://forum.kirupa.com/t/linking-troubles/252392/1 "2008-02-19T19:13:48Z")

</div>

Currently I’m trying to get my images to link to external urls, how ever I’m currently doing something wrong where I get an undefined error when I click on the links. The code I’m using is as fallows

> 

function loadXML(loaded) {

if (loaded) {

xmlNode = this.firstChild;  
thumbnails = ;

total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {

thumbnails\* = xmlNode.childNodes\*.childNodes[2].firstChild.nodeValue;  
thumbnails\_fn(i);

}  
firstImage();

} else {

content = “file not loaded!”;

}

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

function thumbNailScroller() {

// thumbnail code!  
this.createEmptyMovieClip(“tscroller”, 1000);

scroll\_speed = 5;

tscroller.onEnterFrame = function() {

if ((\_root.\_ymouse\>=thumbnail\_mc.\_y) && (\_root.\_ymouse\<=thumbnail\_mc.\_y+thumbnail\_mc.\_height)) {

if ((\_root.\_xmouse\>=(hit\_right.\_x-40)) && (thumbnail\_mc.hitTest(hit\_right))) {

thumbnail\_mc.\_x -= scroll\_speed;

} else if ((\_root.\_xmouse\<=40) && (thumbnail\_mc.hitTest(hit\_left))) {

thumbnail\_mc.\_x += scroll\_speed;

}

} else {

delete tscroller.onEnterFrame;

}

};

}

function thumbnails\_fn(k) {

thumbnail\_mc.createEmptyMovieClip(“t”+k, thumbnail\_mc.getNextHighestDepth());  
tlistener = new Object();  
tlistener.onLoadInit = function(target\_mc) {

target\_mc.\_x = hit\_left.\_x+(eval(“thumbnail\_mc.t”+k).\_width+5)\*k;  
target\_mc.pictureValue = k;  
target\_mc.onRelease = function() {

getURL(destinationURL, “\_self”);

};  
target\_mc.onRollOver = function() {

this.\_alpha = 50;  
thumbNailScroller();

};  
target\_mc.onRollOut = function() {

this.\_alpha = 100;

};

};  
image\_mcl = new MovieClipLoader();  
image\_mcl.addListener(tlistener);  
image\_mcl.loadClip(thumbnails[k], “thumbnail\_mc.t”+k);

}

And my XML is

> \<images\>  
> \<pic\>  
> \<thumbnail\>thumbnail/thumbnail1.jpg.\</thumbnail\>  
> \<destinationURL address=“[http://uk.news.yahoo.com](http://uk.news.yahoo.com)”\>\</destinationURL\>  
> \</pic\>  
> \<pic\>  
> \<thumbnail\>thumbnail/thumbnail2.jpg\</thumbnail\>  
> \<destinationURL address=“[http://uk.news.yahoo.com](http://uk.news.yahoo.com)”\>\</destinationURL\>  
> \</pic\>  
> \<pic\>  
> \<thumbnail\>thumbnail/thumbnail3.jpg\</thumbnail\>  
> \<destinationURL address=“[http://uk.news.yahoo.com](http://uk.news.yahoo.com)”\>\</destinationURL\>  
> \</pic\>  
> \<pic\>  
> \<thumbnail\>thumbnail/thumbnail4.jpg\</thumbnail\>  
> \<destinationURL address=“[http://uk.news.yahoo.com](http://uk.news.yahoo.com)”\>\</destinationURL\>  
> \</pic\>  
> \<pic\>  
> \<thumbnail\>thumbnail/thumbnail5.jpg\</thumbnail\>  
> \<destinationURL address=“[http://uk.news.yahoo.com](http://uk.news.yahoo.com)”\>\</destinationURL\>  
> \</pic\>  
> \</images\>

I’m betting I’ve forgotten to do something stupid…
