# Photo Gallery question

**URL:** <https://forum.kirupa.com/t/photo-gallery-question/61411>\
**Category:** flash\
**Created:** [August 18, 2004, 12:22pm UTC](https://forum.kirupa.com/t/photo-gallery-question/61411 "2004-08-18T12:22:59Z")\
**Posts on this page:** 19\
**Page:** 2

<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:** [March 30, 2006, 4:38pm UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/21 "2006-03-30T16:38:08Z")

</div>

welcome=)

---

<div class="post-metadata">

**Author:** ![MyFairDiva](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/myfairdiva/32/2304_2.png) [@MyFairDiva](https://forum.kirupa.com/u/MyFairDiva)\
**Post date:** [March 30, 2006, 4:45pm UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/22 "2006-03-30T16:45:36Z")

</div>

Scotty Hi, I was wondering if you could see my post? called “Newbie needs help with photogallery” I would appreciate it very much since I’m having problems. I followed the tutorial, and made a special folder on my desktop just to test it, but when I wrote the path to the pictures “C:\Documents and Settings\Cinthia\Escritorio\imagenes” it gave me an error saying it couldnt find the pictures. Thank you very much.

---

<div class="post-metadata">

**Author:** ![layin](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@layin](https://forum.kirupa.com/u/layin)\
**Post date:** [March 30, 2006, 10:28pm UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/23 "2006-03-30T22:28:05Z")

</div>

Thanks a lot scotty :sure:

---

<div class="post-metadata">

**Author:** ![layin](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@layin](https://forum.kirupa.com/u/layin)\
**Post date:** [March 31, 2006, 12:00am UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/24 "2006-03-31T00:00:17Z")

</div>

Hi Scotty

The stop button works well, it stopped the photo from playing.

I inputed the following code into action layer, and created 2 button with instance (play\_btn , stop\_btn)

However, when I pressed on the play button, the action will not take place. The photo is still paused.

Following are my code

* * *

myInterval = setInterval(this, “changePhoto”, 5000, 1);

play\_btn.enabled = 0;  
stop\_btn.onRelease = function(){  
clearInterval(myInterval)  
play\_btn.enabled = 1;  
}  
play\_btn.onRelease = function(){  
this.enabled =0;  
myInterval = setInterval(this, “changePhoto”, 5000, 1);  
}

* * *

Thank 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:** [March 31, 2006, 6:02am UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/25 "2006-03-31T06:02:13Z")

</div>

My bad the path is wrong, the “this” in the setInterval refers to the button,try

```auto
play_btn.onRelease = function(){
this.enabled =0;
myInterval = setInterval(this._parent, "changePhoto", 5000, 1);
}

```

scotty(-:

---

<div class="post-metadata">

**Author:** ![layin](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@layin](https://forum.kirupa.com/u/layin)\
**Post date:** [March 31, 2006, 8:46pm UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/26 "2006-03-31T20:46:43Z")

</div>

Wow, that worked very well  
Thx soooo much Scotty:bounce:

---

<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:** [March 31, 2006, 9:45pm UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/27 "2006-03-31T21:45:31Z")

</div>

you’re welcome=)

---

<div class="post-metadata">

**Author:** ![kirsy](https://avatars.discourse-cdn.com/v4/letter/k/ecccb3/32.png) [@kirsy](https://forum.kirupa.com/u/kirsy)\
**Post date:** [April 11, 2006, 10:20am UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/28 "2006-04-11T10:20:55Z")

</div>

Hi There

I made the foto gallery, everything is working, i had just one question, is it possible to center the picture’s, because when i open it now, and the picture is not big enough, it alignes to the left.

Please help me 🙂  
Greets from holland

---

<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 11, 2006, 11:16am UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/29 "2006-04-11T11:16:16Z")

</div>

[http://www.kirupa.com/forum/showthread.php?t=80278](http://www.kirupa.com/forum/showthread.php?t=80278) post #4

scotty(-:

---

<div class="post-metadata">

**Author:** ![ricferr](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@ricferr](https://forum.kirupa.com/u/ricferr)\
**Post date:** [April 12, 2006, 4:13am UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/30 "2006-04-12T04:13:32Z")

</div>

Hi, I’ve used the XML photogallery from the Kirupa tutorial before without any problems. In a new website ([www.jardimbotanicodajuda.com](http://www.jardimbotanicodajuda.com)) I’m almost finished, I don’t know what’s wrong but the gallery behaves as if it were a slideshow. when I test it on my PC, it works just fine by clicking on the buttons.

anyone with some idea of what might be causing this weird behaviour?

thanks in advance

RF

---

<div class="post-metadata">

**Author:** ![ricferr](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@ricferr](https://forum.kirupa.com/u/ricferr)\
**Post date:** [April 12, 2006, 4:40am UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/31 "2006-04-12T04:40:38Z")

</div>

I suspect it has something to do with the first picture not being loaded as the MC loads. But my XML knowledge doesn’t go deep enough to solve it.

here is my code:

```auto
System.useCodepage = true;
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("0fotos/13colecbot/pics13colecbot.xml");
///////////////////////////////////// 
listen = new Object();

Key.addListener(listen);
previous_btn.onRelease = function() {
	prevImage();
};
next_btn.onRelease = function() {
	nextImage();
};

/////////preloader////////////////////////////
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;
}

```

thanks again

RF

---

<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 12, 2006, 9:22am UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/32 "2006-04-12T09:22:42Z")

</div>

> [@ricferr](#):
>
> …I don’t know what’s wrong but the gallery behaves as if it were a slideshow. when I test it on my PC, it works just fine by clicking on the buttons.
> 
> anyone with some idea of what might be causing this weird behaviour?
> 
> thanks in advance
> 
> RF

Could you explain more?

scotty(-:

---

<div class="post-metadata">

**Author:** ![ricferr](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@ricferr](https://forum.kirupa.com/u/ricferr)\
**Post date:** [April 12, 2006, 1:47pm UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/33 "2006-04-12T13:47:38Z")

</div>

I have this photo gallery ([www.jardimbotanicodajuda.com/13main.html](http://www.jardimbotanicodajuda.com/13main.html)) which works fine on my PC and has worked fine in other websites.

However, when I try to make it work online, it behaves as an almost random slideshow. Once you press the previous photo button, it starts shifting from photo to photo as if it were a slideshow.

Furthermore, while changing from one picture to the next, it doesn’t follow the correct sequence (1, 2, 3, 4, etc…). Instead, it skips one or two pictures, even when you try to browse the gallery with the buttons.

I can’t understand what’s happening because I’ve used the exact same code before and it worked fine. On the same website, I’m using several slideshows with a similar script. I thought that maybe the variables would be messing up between them but I put that hypothesis aside when I isolated the page with the photogallery.

I ran out of ideas. Do you have any?

thanks

RF

---

<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 14, 2006, 7:47am UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/34 "2006-04-14T07:47:43Z")

</div>

> [@ricferr](#):
>
> …I ran out of ideas. Do you have any?..

No, can you post your files?

scotty(-:

---

<div class="post-metadata">

**Author:** ![ricferr](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@ricferr](https://forum.kirupa.com/u/ricferr)\
**Post date:** [April 17, 2006, 1:14pm UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/35 "2006-04-17T13:14:11Z")

</div>

> [@scotty](#):
>
> No, can you post your files?
> 
> scotty(-:

Hi, I’m sending you attached the FLA file and the XML.

thanks for everything

RF

---

<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 18, 2006, 6:22am UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/36 "2006-04-18T06:22:36Z")

</div>

Works fine here, but I see no slideshow code?

scotty(-:

---

<div class="post-metadata">

**Author:** ![ricferr](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@ricferr](https://forum.kirupa.com/u/ricferr)\
**Post date:** [April 18, 2006, 2:48pm UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/37 "2006-04-18T14:48:29Z")

</div>

> [@scotty](#):
>
> Works fine here, but I see no slideshow code?
> 
> scotty(-:

Hi scotty,

It works fine on my PC as well. The problem comes when I upload it to the server. And it’s not a problem of paths because both the caption and the picture are found by the swf and XML files. It just doesn’t run properly.

The slideshow code is on the first frame of the “actions” layer in the 13main.fla file.

thanks

RF

---

<div class="post-metadata">

**Author:** ![ricferr](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@ricferr](https://forum.kirupa.com/u/ricferr)\
**Post date:** [April 24, 2006, 12:56am UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/38 "2006-04-24T00:56:49Z")

</div>

Anyone else has any idea of what might be wrong?

thanks

RF

---

<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 24, 2006, 8:28am UTC](https://forum.kirupa.com/t/photo-gallery-question/61411/39 "2006-04-24T08:28:30Z")

</div>

If I look at the link, it can’t find the first picture, check the paths.

scotty(-:

[Previous page](https://forum.kirupa.com/t/photo-gallery-question/61411.md?page=1)
