One final photo_gallery question

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);
}
};

anyone?

never mind, i got it.

umm how did you get it?

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]);

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…?

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.