# Adding links to photo slideshow

**URL:** https://forum.kirupa.com/t/adding-links-to-photo-slideshow/152386
**Category:** flash
**Created:** [June 24, 2005, 1:45pm UTC](https://forum.kirupa.com/t/adding-links-to-photo-slideshow/152386 "2005-06-24T13:45:29Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![jordanchitty](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jordanchitty](https://forum.kirupa.com/u/jordanchitty)
#### Post date: [June 24, 2005, 1:45pm UTC](https://forum.kirupa.com/t/adding-links-to-photo-slideshow/152386/1 "2005-06-24T13:45:29Z")

</div>

Hi.

Been reading all the tutorials and looking at the forum, but haven’t found an answer to this yet. I want to add links to each of the images loading in a slideshow.

On kirupa’s tutorial [http://www.kirupa.com/developer/mx2004/thumbnails.htm](http://www.kirupa.com/developer/mx2004/thumbnails.htm) on thumbnails the example on the site has links on each of the images loaded, but I can’t find where this is referenced to in the tutorial itself or the source files.

There’s a \<link\> field for each picture in the xml file, but this is not being accessed by the fla file that I have downloaded. How do I do this?

Thanks

---

<div class="post-metadata">

### Author: ![ztowne](https://avatars.discourse-cdn.com/v4/letter/z/dfb087/32.png) [@ztowne](https://forum.kirupa.com/u/ztowne)
#### Post date: [March 30, 2006, 3:40pm UTC](https://forum.kirupa.com/t/adding-links-to-photo-slideshow/152386/2 "2006-03-30T15:40:32Z")

</div>

> [@kirupa](#):
>
> Ah! I knew the tutorial was too short 😛 I will write that shortly. Your XML file would look like the following: [**[u]http://www.kirupa.com/developer/mx2004/images.xml[/u]**](http://www.kirupa.com/developer/mx2004/images.xml) Notice where I have ‘link’ specified.
> 
> Cheers!  
> Kirupa:nerd:

this link displays a list of url’s - but is not an xml file as far as i can tell.

i’ve got things working - except that i get the same “undefined” url request somebody else mentioned earlier. any new info up abou tthis?

thanks  
zach

---

<div class="post-metadata">

### Author: ![feeverte](https://avatars.discourse-cdn.com/v4/letter/f/278dde/32.png) [@feeverte](https://forum.kirupa.com/u/feeverte)
#### Post date: [April 10, 2006, 9:21am UTC](https://forum.kirupa.com/t/adding-links-to-photo-slideshow/152386/3 "2006-04-10T09:21:02Z")

</div>

> [@quovadimus02](#):
>
> I’m trying to make the links open in a new popup window and I’m running into some problems with the javascript. This is what I have and it looks like it should work to me…but obviously I wouldn’t be here if it did work.

Have you sorted it?  
Else

> **[kirupa.com - Launching a Centered Pop-Up Window](https://www.kirupa.com/developer/mx/centered_popup.htm)**
>
> Create a pop-up window that is centered and can be extensively customized.

---

<div class="post-metadata">

### Author: ![feeverte](https://avatars.discourse-cdn.com/v4/letter/f/278dde/32.png) [@feeverte](https://forum.kirupa.com/u/feeverte)
#### Post date: [April 10, 2006, 9:25am UTC](https://forum.kirupa.com/t/adding-links-to-photo-slideshow/152386/4 "2006-04-10T09:25:20Z")

</div>

Also…(I may be talking nonsense here be warned) if your paths are correct and u get undefined it maybe that you have saved the jpg progressive? I think it doesnt work with progressive or gifs…  
If this is not relevant apologies

---

<div class="post-metadata">

### Author: ![s3r3n1t1](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@s3r3n1t1](https://forum.kirupa.com/u/s3r3n1t1)
#### Post date: [April 18, 2006, 6:56pm UTC](https://forum.kirupa.com/t/adding-links-to-photo-slideshow/152386/5 "2006-04-18T18:56:41Z")

</div>

One thing I was wondering about this, was if there was a way of jumping to the first or last image, if there is then I can use it for my webcomic.

---

<div class="post-metadata">

### Author: ![s3r3n1t1](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@s3r3n1t1](https://forum.kirupa.com/u/s3r3n1t1)
#### Post date: [April 18, 2006, 7:35pm UTC](https://forum.kirupa.com/t/adding-links-to-photo-slideshow/152386/6 "2006-04-18T19:35:29Z")

</div>

Actually, If someone could help with my above question that would be great, I didn;t want to start a whole new thread, and there are lots on this photo gallery, basically, I want the viewer to be able to click next prev as they currently can and also jump to the first and last, is this possible?

Current code, as per the tute.

```auto

function loadXML(loaded) {

if (loaded) {

xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {

image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;

}
firstImage();

} else {

content = "file not loaded!";

}

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

previous_btn.onRelease = function() {

prevImage();

};
next_btn.onRelease = function() {

nextImage();

};
first_btn.onRelease = function() {

firstImage();

};
last_btn.onRelease = function() {

lastImage();

};
/////////////////////////////////////
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];
picture_num();

}

}

}
function prevImage() {

if (p>0) {

p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();

}

}
function firstImage() {

if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();

}

}
function picture_num() {

current_pos = p+1;
pos_txt.text = current_pos+" / "+total;

}

```

(I really struggle with scripting I’ve never been a coder, only an artist/designer and no matter how hard I try I find my brain switching off completely when I try to work out actionscript, I think the left side of my brain is holding the right side hostage, so help is most welcome)

---

<div class="post-metadata">

### Author: ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)
#### Post date: [April 19, 2006, 6:57am UTC](https://forum.kirupa.com/t/adding-links-to-photo-slideshow/152386/7 "2006-04-19T06:57:34Z")

</div>

You want a seperate button for that or eg if they click the next\_btn when the last image is shown the first image comes up?

scotty(-:

---

<div class="post-metadata">

### Author: ![s3r3n1t1](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@s3r3n1t1](https://forum.kirupa.com/u/s3r3n1t1)
#### Post date: [April 19, 2006, 9:37am UTC](https://forum.kirupa.com/t/adding-links-to-photo-slideshow/152386/8 "2006-04-19T09:37:15Z")

</div>

Hi, preferably seperate, so you will have 4 buttons

First (Jump back to start)  
prev (Previous Comic)  
Next (Next Comic)  
Last (Jump to last Comic)

Thanks in advance 😃

---

<div class="post-metadata">

### Author: ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)
#### Post date: [April 19, 2006, 2:17pm UTC](https://forum.kirupa.com/t/adding-links-to-photo-slideshow/152386/9 "2006-04-19T14:17:20Z")

</div>

Name those extra buttons ‘first\_btn’ and ‘last\_btn’

```auto
first_btn.onRelease = function(){
   firstImage();
}
last_btn.onRelease = function(){
p=total-1;
picture._alpha = 0;
picture.loadMovie(image[p]);
desc_txt.text = description[p];
picture_num();
}

```

scotty(-:

---

<div class="post-metadata">

### Author: ![s3r3n1t1](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@s3r3n1t1](https://forum.kirupa.com/u/s3r3n1t1)
#### Post date: [April 19, 2006, 2:49pm UTC](https://forum.kirupa.com/t/adding-links-to-photo-slideshow/152386/10 "2006-04-19T14:49:31Z")

</div>

A thousand thanks Mr scotty 🙂

now uploading the comic will be a piece of cake, and the site is only 6kb in size before the external swfs are loaded. So happy days for 56kers.  
🍺

---

<div class="post-metadata">

### Author: ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)
#### Post date: [April 19, 2006, 2:51pm UTC](https://forum.kirupa.com/t/adding-links-to-photo-slideshow/152386/11 "2006-04-19T14:51:08Z")

</div>

welcome=)
