# One final photo\_gallery question

**URL:** https://forum.kirupa.com/t/one-final-photo-gallery-question/116512
**Category:** Uncategorized
**Created:** [July 19, 2004, 3:25am UTC](https://forum.kirupa.com/t/one-final-photo-gallery-question/116512 "2004-07-19T03:25:41Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![invisible7](https://avatars.discourse-cdn.com/v4/letter/i/779978/32.png) [@invisible7](https://forum.kirupa.com/u/invisible7)
#### Post date: [July 19, 2004, 3:25am UTC](https://forum.kirupa.com/t/one-final-photo-gallery-question/116512/1 "2004-07-19T03:25:41Z")

</div>

This is it. Really!

How does one change the location that the pics are called from?

The xml path was easy for me because there is a path type that I’m familiar with – gallery\_xml.load(“whateverHERE/gallery.xml”);-- but I just can’t see where to put the path to pics. I saw a path built into the xml file example I used – \<gallery path=“whateverHERE/”\> – but that doesn’t seem to effect anything. As it stands, the code below requires the pic’s to be in the same folder as the .swf.

* * *

spacing = 10;  
bar.\_visible = false;  
containerMC.\_alpha = 0;  
var pArray = new Array();  
var tArray = new Array();  
var t2Array = new Array();  
var t3Array = new Array();  
var t4Array = new Array();  
var t5Array = new Array();  
var t6Array = new Array();  
var thumbArray = new Array();  
MovieClip.prototype.loadPic = function(pic) {  
containerMC.\_alpha = 0;  
cur = pic;  
this.loadMovie(pArray[pic]);  
this.\_parent.onEnterFrame = function() {  
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();  
bar.\_visible = true;  
percentage.\_visible = true;  
per = Math.round((l/t)\*100);  
if (t != 0 && Math.round(l/t) == 1 && containerMC.\_width != 0) {  
var w = containerMC.\_width+spacing, h = containerMC.\_height+spacing;  
border.resizeMe(w, h);  
bar.\_visible = false;  
percentage.\_visible = false;  
title.text = tArray[pic];  
medium.text = t2Array[pic];  
date.text = t3Array[pic];  
plate.text = t4Array[pic];  
series.text = t5Array[pic];  
paper.text = t6Array[pic];

```
		delete this.onEnterFrame;
	} else {
		bar._width = per;
		percentage.text = per+" % loaded";
	}
};

```

};  
MovieClip.prototype.resizeMe = function(w, h, pic) {  
var speed = 3;  
this.onEnterFrame = function() {  
this.\_width += (w-this.\_width)/speed;  
this.\_height += (h-this.\_height)/speed;  
if (Math.abs(this.\_width-w)\<1 && Math.abs(this.\_height-h)\<1) {  
this.\_width = w;  
this.\_height = h;  
containerMC.\_x = this.\_x-this.\_width/2+spacing/2;  
containerMC.\_y = this.\_y-this.\_height/2+spacing/2;  
containerMC.\_alpha += 5;  
if (containerMC.\_alpha\>90) {  
containerMC.\_alpha = 100;  
delete this.onEnterFrame;  
}  
}  
};  
};  
var gallery\_xml = new XML();  
gallery\_xml.ignoreWhite = true;  
gallery\_xml.onLoad = function(success) {  
if (success) {  
var gallery = this.firstChild;  
//you had here i=-1;etc it should zero, cause xml(childnodes) are like arrays zerobased  
for (var i = 0; i\<gallery.childNodes.length; i++) {  
tArray.push(gallery.childNodes\*.attributes.title);  
t2Array.push(gallery.childNodes\*.attributes.medium);  
t3Array.push(gallery.childNodes\*.attributes.date);  
t4Array.push(gallery.childNodes\*.attributes.plate);  
t5Array.push(gallery.childNodes\*.attributes.series);  
t6Array.push(gallery.childNodes\*.attributes.paper);  
pArray.push(gallery.childNodes\*.attributes.source);  
thumbArray.push(gallery.childNodes\*.attributes.thumb);  
}  
// it takes a little time before the arrays are set, so we need an interval  
//to be sure that the arrays are defined  
//interval for loading the first picture  
delay = setInterval(loadFirst, 100);  
//interval for duplicating the thumbs, the id is global,  
//so it can be easy reset in scrll  
\_global.idsetTh = setInterval(dragwindow.scrll, “setThumbs”, 100);  
//interval for loading the thumb pictures  
\_global.idloTh = setInterval(dragwindow.scrll, “lothmb”, 100, 0);  
} else {  
persentage.text = “Error!”;  
}  
};  
//function for loading the first picture  
function loadFirst() {  
clearInterval(delay);  
//0 is the first pic in the array  
containerMC.loadPic(0);  
}  
gallery\_xml.load(“barcelona/gallery.xml”);  
prevb.onRelease = function() {  
//cur == 0 ;-))  
if (cur == 0) {  
containerMC.loadPic(pArray.length-1);  
} else {  
containerMC.loadPic(cur-1);  
}  
};  
nextb.onRelease = function() {  
if (cur == pArray.length-1) {  
//loadPic(0)!!! ;-)))  
containerMC.loadPic(0);  
} else {  
containerMC.loadPic(cur+1);  
}  
};

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 20, 2004, 2:28am UTC](https://forum.kirupa.com/t/one-final-photo-gallery-question/116512/2 "2004-07-20T02:28:53Z")

</div>

anyone?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 20, 2004, 3:45am UTC](https://forum.kirupa.com/t/one-final-photo-gallery-question/116512/3 "2004-07-20T03:45:51Z")

</div>

never mind, i got it.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 20, 2004, 8:19am UTC](https://forum.kirupa.com/t/one-final-photo-gallery-question/116512/4 "2004-07-20T08:19:15Z")

</div>

umm how did you get it?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 22, 2004, 5:02am UTC](https://forum.kirupa.com/t/one-final-photo-gallery-question/116512/5 "2004-07-22T05:02:27Z")

</div>

Needed another variable, ie “pathTO”, then added that to the loadMovie function.

stop();  
spacing = 10;  
bar.\_visible = false;  
pathTo = ‘images/barcelona/’;  
containerMC.\_alpha = 0;  
var pArray = new Array();  
var tArray = new Array();  
var t2Array = new Array();  
var t3Array = new Array();  
var t4Array = new Array();  
var t5Array = new Array();  
var t6Array = new Array();  
var thumbArray = new Array();  
var curArray = new Array();  
MovieClip.prototype.loadPic = function(pic) {  
containerMC.\_alpha = 0;  
cur = pic;

```
this.loadMovie(pathTo+pArray[pic]);
```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 23, 2004, 5:29pm UTC](https://forum.kirupa.com/t/one-final-photo-gallery-question/116512/6 "2004-07-23T17:29:36Z")

</div>

Hey invisiable7 could you possibly post the fla for that…im having truble understanding it, cause im in need of a gallery aswell but nothing seems to work, i want to make something dynamic, just add photos to a folder and tell flash to just take each on in the folder and load them each in their respected places on the main movie…?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 23, 2004, 8:13pm UTC](https://forum.kirupa.com/t/one-final-photo-gallery-question/116512/7 "2004-07-23T20:13:29Z")

</div>

[http://www.kirupaforum.com/forums/showthread.php?t=51430](http://www.kirupaforum.com/forums/showthread.php?t=51430)

this is the thread that should answer most questions+ a variety of prototype downloads, but if you want your images to load in diff. places all at once your going to need to do something else. What I’ve got is a gallery page that has a click through and a thumbnail scroller to select images.
