[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 653
  • Last Modified:

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

0
rrattie
Asked:
rrattie
  • 4
  • 3
1 Solution
 
wal_toorCommented:
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
0
 
rrattieAuthor Commented:
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
0
 
rrattieAuthor Commented:
BTW, this is related to the other question I had posted about moving between the 3 different galleries.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
wal_toorCommented:
Hellow rrattie,

I have changed the xml files (image paths so it works local and online) and the flash files (all changes are commented), and it nows seems to work. I have uploaded the files on my server to test them, and the popup works like it should.

Ow, i have also changed the publisch settings of the flash file, it could'nt find you desktop :-)

Demo:

http://www.zoetebroodjes.nl/downloads/slider/

Download files:

http://www.zoetebroodjes.nl/downloads/slider/help_1.zip

As for the sliding thing. This is not going to work the way it is build now. When you click on a gallery button the gallery is replaced by another gallery because you use loadMovieNum. If you really want to slide the "old" gallery to the end, and the replace this by the new one you need to add a function that first scrolls the gallery out, and the load the new gallery in its place.

If this is still what you need, i can think of a little script that does this.

greetz,
walter
0
 
rrattieAuthor Commented:
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?
0
 
wal_toorCommented:
Hellow rrattle,

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

greetz,
walter
0
 
rrattieAuthor Commented:
Walter you rock! Thanks so much!!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now