dynamic loading thumbs, need help


#1

Hey,

I got a bit of a problem with my latest site.
I’m using an Xml file to read a bunch of variables and build the site accordingly.
In one of the sections I load a gallery of images(the thumbnails) into the page, after which you should be able to click the thumbs to open up the big versions.
The images load and are placed perfectly.
However, I can’t click em.
I added the code so you guys and gals can take a look at it for yourselves.

for(var o=0; o<xmldoc.firstChild.childNodes[2].childNodes[chapter].childNodes.length; o++){
for(var q=0; q<xmldoc.firstChild.childNodes[2].childNodes[chapter].childNodes[o].childNodes.length; q++){
createEmptyMovieClip(o+“image”+q,(o+1)*100+q)
//there’s some positioning code here.
Image = “Images/”+xmldoc.firstChild.childNodes[2].childNodes[chapter].childNodes[o].childNodes[q].attributes.name+".jpg"
loadMovie(Image,this[o+“image”+q])

//I think the problem is down here
this[o+“image”+q].onEnterFrame = function() {
loaded = this.getBytesLoaded();
total = this.getBytesTotal();

if (loaded>0 and loaded == total) {
this.onRelease = function() {
getURL(“big/”+xmldoc.firstChild.childNodes[2].childNodes[chapter].childNodes[o].childNodes[q].attributes.link+".jpg", _blank);
};
this.onEnterFrame = null;
}
};

Any ideas on how to make the thumbs clickable?
I’m really annoyed with this one …


#2

Problem solved.
So, never mind, not that anyone did of course…

Expect to see the site shortly!


#3

i wanted to help i just dont know any thing :wavey:


#4

I was going to help last night but my 2 year old son woke up crying because of a nightmare and I had to go sleep with him. :shrug:

Hey next time you post some code, use the code tag to keep the formating so that it won’t be as hard to follow. For example, this is some code I wrote to create some text effects with an externally loaded text string:

onClipEvent(load) {
	this.loadVariables("data.txt");
	startXpos = 40;
	startYpos = 40;
	nextX = startXpos;
	elapsedTime = 0;
	enterTime = 0;
	i=0;
}

onClipEvent(data) {
	newLetters = newArray();
	newLetters = dataString.split("");
}

onClipEvent(enterFrame) {

	if (elapsedTime > 100) {
		enterTime = getTimer();
		if (i < this.newLetters.length) {

			_root.attachMovie("letter", "letter"+i, i);
			with (_root["letter"+i]) {
			
				letterContainer.letter.text = newLetters[i];
				_x = nextX;
				_y = startYpos;
			}
			nextX = _root["letter"+i]._x + _root["letter"+i].letterContainer.letter.textWidth;
			++i;
			elapsedTime = 0;
		}
	}else{
		elapsedTime = getTimer() - enterTime;
	}
}

Here’s what this looks like: TextEffects


#5

Thanks guys :slight_smile:

I didn’t know about the code-quote :blush:
I’m not used to posting code.


#6

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.