# Adding a link to a xml loaded image

**URL:** <https://forum.kirupa.com/t/adding-a-link-to-a-xml-loaded-image/196978>\
**Category:** flash\
**Created:** [August 12, 2006, 10:12am UTC](https://forum.kirupa.com/t/adding-a-link-to-a-xml-loaded-image/196978 "2006-08-12T10:12:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinnieb](https://avatars.discourse-cdn.com/v4/letter/v/ba8739/32.png) [@vinnieb](https://forum.kirupa.com/u/vinnieb)\
**Post date:** [August 12, 2006, 10:12am UTC](https://forum.kirupa.com/t/adding-a-link-to-a-xml-loaded-image/196978/1 "2006-08-12T10:12:08Z")

</div>

Hi all,  
I’ve got a xml gallery. Now I want to add a link to a image but I don’t know how to do this.  
This is my code:

[FONT=Arial]_[FONT=Arial]portfolioInfo = new XML();[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial]portfolioInfo.ignoreWhite = true;[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial]timeline = this;[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial]baseurl = \_url.substr(0,\_url.lastIndexOf("/")+1);[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial]portfolioInfo.onLoad = function(){[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] [/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] portfolioTag = this.firstChild;[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] [/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial]trace( count = portfolioTag.childNodes.length);[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] [/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] for (child = 0; child \< count; child++){[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] [/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial]currentPicture = portfolioTag.childNodes[child];[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] [/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial]currentThumb = menu\_mc.createEmptyMovieClip(“thumbnail”+child,child);[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] [/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial]currentThumb.\_x = child \* 40;[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] [/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] image = currentThumb.createEmptyMovieClip(“thumbnail\_image”,0);[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] image.loadMovie(baseurl + currentPicture.attributes.THUMB);[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] [/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] currentThumb.NAME = currentPicture.attributes.NAME;[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] currentThumb.IMAGE = currentPicture.attributes.IMAGE;[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] currentThumb.TEXT = currentPicture.attributes.TEXT;[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] currentThumb.onRollOver = currentThumb.onDragOver = function(){[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] showName\_txt.text = this.NAME;[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] }[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] [/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] currentThumb.onRollOut = currentThumb.onDragOut = function(){[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] [/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] showName\_txt.text = “”;[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] }[/FONT]_[/FONT]  
[FONT=Arial]_[COLOR=Red][FONT=Arial] currentThumb.onPress = currentThumb.onDragOver = function(){[/FONT][/COLOR]_[/FONT]  
[FONT=Arial]_[COLOR=Red][FONT=Arial] image\_mc.loadMovie(baseurl + this.IMAGE);[/FONT][/COLOR]_[/FONT]  
[FONT=Arial]_[COLOR=Red][FONT=Arial] info\_txt.text = “Loading…”;[/FONT][/COLOR]_[/FONT]  
[FONT=Arial]_[FONT=Arial][COLOR=Red] timeline.loadVariables(baseurl + this.TEXT);[/COLOR][/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] }[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial] }[/FONT]_[/FONT]  
[FONT=Arial]_[FONT=Arial]}[/FONT]_[/FONT]  
[FONT=Arial][FONT=Arial]_portfolioInfo.load(baseurl + “xmlportfoliowithimageandtext.xml”);_[/FONT][/FONT]

I made the piece red where I think to make a link. I want [FONT=Arial]_[COLOR=Red][FONT=Arial] image\_mc.loadMovie(baseurl + this.IMAGE); [/FONT][/COLOR]_[/FONT]to give a link from the xml file. This is the xml file:  
_[COLOR=Red]  
[COLOR=Black]\<PORTFOLIO\>  
\<PICTURE NAME=“My Disk”  
TEXT=“xmlportfoliowithimageandtext/text/description1.txt”  
THUMB=“xmlportfoliowithimageandtext/images/thumbs/image1.jpg”  
IMAGE=“xmlportfoliowithimageandtext/images/image1.jpg”  
/\>  
\<PICTURE NAME=“My Plug”  
TEXT=“xmlportfoliowithimageandtext/text/description2.txt”  
THUMB=“xmlportfoliowithimageandtext/images/thumbs/image2.jpg”  
IMAGE=“xmlportfoliowithimageandtext/images/image2.jpg”  
/\>  
\</PORTFOLIO\>[/COLOR][/COLOR]_

Now I want to add something like

[COLOR=Red]_link=“[www.thelinksite.com](http://www.thelinksite.com)”_[/COLOR]

But I don’t know how to do this, can someone with more experience help, would be great.
