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”[/COLOR]
But I don’t know how to do this, can someone with more experience help, would be great.