Link to home
Start Free TrialLog in
Avatar of rrattie
rrattieFlag for United States of America

asked on

XML scrolling gallery needs links on images.

I have a working "horizontal scrolling image gallery" that needs one more thing. I want to put links to full size images on the images that are in the gallery.

So, when you click on an image in the gallery, it would open in a separate window (html)

Here is my code so far.
function loadXML(loaded) {
	if (loaded) {
		xmlNode = this.firstChild;
		thumbnails = [];
		total = xmlNode.childNodes.length;
		for (i=0; i<total; i++) {
			thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
			thumbnails_fn(i);
		}
		firstImage();
	} else {
		content = "file not loaded!";
	}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
///////////////////////////////////// 
listen = new Object();
listen.onKeyDown = function() {
	if (Key.getCode() == Key.LEFT) {
		prevImage();
	} else if (Key.getCode() == Key.RIGHT) {
		nextImage();
	}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
	prevImage();
};
next_btn.onRelease = function() {
	nextImage();
};
///////////////////////////////////// 
p = 0;
 
function thumbNailScroller() {
	// thumbnail code! 
	this.createEmptyMovieClip("tscroller", 1000);
	scroll_speed = 10;
	tscroller.onEnterFrame = function() {
		if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
			if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
				thumbnail_mc._x -= scroll_speed;
			} else if ((_root._xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
				thumbnail_mc._x += scroll_speed;
			}
		} else {
			delete tscroller.onEnterFrame;
		}
	};
}
function thumbnails_fn(k) {
	thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
	tlistener = new Object();
	tlistener.onLoadInit = function(target_mc) {
		target_mc._x = hit_left._x+(target_mc._width+60)*k;
		target_mc.pictureValue = k;
		target_mc.onRelease = function() {
			p = this.pictureValue-1;
			nextImage();
		};
		target_mc.onRollOver = function() {
			this._alpha = 80;
			thumbNailScroller();
		};
		target_mc.onRollOut = function() {
			this._alpha = 100;
		};
	};
	image_mcl = new MovieClipLoader();
	image_mcl.addListener(tlistener);
	image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}

Open in new window

Avatar of wal_toor
wal_toor
Flag of Netherlands image

Hellow rrattie,

You can set these values in your xml file. So you have the thumbnail location and the highres location. To open these large images in a popup window you need to put a piece of javascript in your html page, and call this with a getURL action (getURL("javascript:openPopup('"+largeLocation+"');");)

if you can profide a working example and an example of your xml file, i can make the changes for you if you like.

greetz,
walter
Avatar of rrattie

ASKER

wal_toor,

I think I know what you mean, but I would really appreciate the help.

Here are my files (xml, fla, jpgs..etc..)http://www.stillpixel.com/files/flash/help.zip
Avatar of rrattie

ASKER

BTW, this is related to the other question I had posted about moving between the 3 different galleries.
ASKER CERTIFIED SOLUTION
Avatar of wal_toor
wal_toor
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rrattie

ASKER

That works great! Thanks so much!

If you could think of a little script to do that, that would be awesome!

*I'm going to accept the solution here and if you come up with a script it can be over on the other question I posted. Sound good?
Hellow rrattle,

Sounds great, I am going to add that slidescript tomorrow morning early. I am now heading home.

greetz,
walter
Avatar of rrattie

ASKER

Walter you rock! Thanks so much!!