XML resize thumbs (hope I'm not beating a dead horse)

[COLOR=black][FONT=Arial]Hello everyone! I’ve been all through these 60 some pages on this subject and didn’t find what totally what I was looking for… of course eye strain might be a problem so if there is a thread to something I ask please tell me. I apologize in advance if I do. This is my first ever thread also.[/FONT][/COLOR]

[COLOR=black][FONT=Arial]Here is a zip of all my files so far. http://marazita.com/funstuff/gallery.zip First here is the link to Scotty’s thumb resize that I’ve put into my .fla. [URL=“http://www.gertdesign.info/kirupa/V3_with_thumbs.zip”][COLOR=#800080]V3_with_thumbs zip[/COLOR] Mine doesn’t work because what I’m trying to do is make the thumbs replace the mc’s that I’ve added (each with an instance name thumb1, thumb2, etc.). As an artist I like to group images that belong in a group. Sometimes a group can have 3 sometimes 4, etc… This is what’s been wrong with what I’ve found in the threads so far. They’ve just been lumped into a certain amount to columns and rows. If you look at my files you’ll understand better. I was also hoping that the thumbs would load like this zipped file [URL=“http://marazita.com/funstuff/gallery_preloadthumbs.zip”]http://marazita.com/funstuff/gallery_preloadthumbs.zip (which is another nice dynamic loaded one that you don’t have control over either). Any help will be greatly appreciated and at the end I’ll post my finished file to share with everyone since I’ve gained so much from this site I would like to also give back. This will help a lot of artists out there I’m sure. Thanks to all that help in advance. I have other questions… but lets do baby steps at first.[/FONT][/COLOR]

[COLOR=black][FONT=Arial]-Justin-[/FONT][/COLOR]

[COLOR=black][FONT=Arial]www.marazita.com[/FONT][/COLOR]

First it’s a bettere to start with thumb0 if your using xml/arrays etc cause they’re zerobased.
Give your allthumbs mc an instancename ‘allthumbs’ and add in slidingthumbs thumb9, that’s missing.
Then change your code like this (I give only the modified code)

function galleryChoice() {
	pArray = new Array();
	tArray = new Array();
	iArray = new Array();
	my_xml = new XML();
	my_xml.ignoreWhite = true;
	my_xml.onLoad = function(loaded) {
		if (loaded) {
			gallery = this.firstChild;
			curLength = gallery.childNodes.length;
			for (var i = 0; i<gallery.childNodes.length; i++) {
				pArray.push(gallery.childNodes*.attributes.source);
				tArray.push(gallery.childNodes*.attributes.thumb);
				iArray.push(gallery.childNodes*.attributes.title);
			}
		}
		delay = setInterval(makeButtons, 50);
	};
	my_xml.load("gallery.xml");
}
function makeButtons() {
	tnNr = 1;
	clearInterval(delay);
	loadButtons();
}
function loadButtons() {
	var tbox = allthumbs.slidingthumbs["thumb"+tnNr];
	tbox.loadMovie(tArray[tnNr-1]);
	temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
	temp.onEnterFrame = function() {
		bt = tbox.getBytesTotal();
		bl = tbox.getBytesLoaded();
		if (bt == bl && bt>4) {
			trace(tnNr);
			nextButton();
			delete this.onEnterFrame;
		}
	};
}
function nextButton() {
	if (tnNr<tArray.length) {
		tnNr++;
		loadButtons();
	} else {
		activateButtons();
	}
}
function activateButtons() {
	mainButtons();
	for (var i = 1; i<=pArray.length; i++) {
		var but = allthumbs.slidingthumbs["thumb"+i];
		but.id = i;
		but.onRelease = function() {
			container.loadPic(pArray[this.id], iArray[this.id]);
			disButtons2(this.id);
		};
	}
	container.loadPic(pArray[0], iArray[0]);
	disButtons2(0);
}

scotty(-:

Thanks for the insanely fast reply! Here’s the updated .fla http://marazita.com/funstuff/main_2.fla The thumbs are off a little bit instead of replacing the thumb’s mc’s… does the registration on the mc’s need to be changed? Also some of the thumbs didn’t load which was odd. And the resize doesn’t work at all… I’m sure this is my fault somehow though. Thank you so much Scotty you’re an invaluable asset to the forums!

-J-

Put the registration point top left i/o centre.
The resizement works here…I’ll have a look at your fla later.

scotty(-:

It was the registration… but the thumbs aren’t buttons and the first instance thumb0 doesn’t load. The other missing thumbs was just a naming problem.

Heh… you beat me to the reply :stuck_out_tongue: Thanks Scotty I’ll be looking forward to it. I hope you have a great day.

First: you have 44 thumbs on stage (thumb0 - thumb43) and 47 nodes in the xml, this way the activateButtons function is never called… change the xml (see attached)
Plus, since you started with thumb0, there were a few errors in the AS:
in the makeButtons;

function makeButtons() {
	//changed 1 to 0
	tnNr = 0;
	clearInterval(delay);
	loadButtons();
}

and in the nextButton:

function nextButton() {
	//changed to tArray.length-1
	if (tnNr<tArray.length-1) {
		tnNr++;
		loadButtons();
	} else {
		activateButtons();
	}
}

scotty(-:

Thanks a heap Scotty. Well on the way to my ideal photogallery. I attached the working files so far. (took out my background image from the .fla so I could upload it) I changed the AS as you told me and it didn’t work… so I just renamed the first one thumb1 and kept the old AS (I know you said it’s best to name it thumb0… but it works now… don’t hit me!! :trout: )

I was wondering if I could make a preloader for the thumbs that’s actually a preloader for the larger image? I was thinking along the lines of making a movieclip and giving it an instance name and having it sit in the library and is called when loading the larger pics on the thumbs. I was thinking along the lines of perhaps a mask (same size as the thumbs that fades in from the bottom… like the thumb is slowly fading in from the bottom up. Is this possible or does it all have to be in actionscript? Any direction would be greatly appreciated. I’m going to link your site (I think it’s your’s… the one in your pro) on mine when I’m done updating it because you’re awesome!

Also one other pondering thought. I was thinking of a rounded edge 50% transperant box in the middle for the border/pic holder. Is it possible to make a mask on the resize box so it has rounded edges or any other shape?

thanks again,
-Justin

I figured out how to mask the resize image. It was fairly easy. I just added a second border mc and gave in an instance name of border2 then added extra AS for it. Check it out! (it sort of warps a little when it’s stretched different then it’s original shape unfortunetly though)

I would still love to hear what you have to say about the loaders though.

Here’s a file with a preloader :slight_smile:
I’ve made some changes to the AS.
For the border mc, there’s a way you can do it but you have to split them in pieces, so the corners keep the same rounding. Check the shadow resize here: http://www.kirupa.com/forum/showthread.php?t=87388

scotty(-:

*edit, and the file…

I came across your preloader going through past threads but thanks again. What I was wondering about preloading that was similiar to stringy’s thumbs:
[U]http://www.fmx6.com/teststuff/resize/artgallery_new2new.swf[/U]
It has a subdued thumb then when the full pic is loaded the thumb is selectable and is bright. The thumbs are so small I don’t think that they even need a preloader since they show up so fast. I attached an example of what I was invisioning as a preloder for the thumbs that meant the full image is loaded. It’s only animated but I was thinking of making the mc’s 100 frames long like a preloader. What do you think?

Thank ya,
-Justin-

Not exactly like your example, but something like this?

scotty(-:

That’s exactly what I was envisioning! Is there a way to make the Transparent thumb preloader represent the large images (pic1, pic2, etc.) loading though? That way you don’t need the preloader in the image resize box at all. Wow! This is going to look so awesome when it’s done. Will be nice to share something this great with everyone too.

Thanks!

So I’m guessing it’s hard to make the Transparent preloader thumbs act like stringy’s?: [U][COLOR=#333333]http://www.fmx6.com/teststuff/resize/artgallery_new2new.swf[/COLOR][/U] I attached his .fla I’ve tried mixing his AS to the mask_update.fla but to no avail. I just like how you don’t need two preloaders. That way everything is just loaded at once.

I don’t see a (transparent) preloader there in the thumbs?

scotty(-:

But I think you’re after something like this, do a Simulate Download to see it working properly:)

scotty(-:

On the mask_update.fla you added a preloader to the thumbs that was transparent. But this was a preloader for the thumb images. And then you had a preloder in the resize box for the large images.

In stringy’s the thumbs have a thumb preloader that actually represents the large images. You’ll notice on the link how the thumb is subdued while the large image is loading then once it’s loaded it’s bright. That way there is only one preloader.

I was wondering if the transparent thumb preload you made could represent the large image loading that way you don’t need the center preloader for the large image it will already be loaded.

Thanks!

That’s very close to what I had envisioned! But can it start loading the Large images at the beginning? So everything is loaded at one time. The thumbs are so small I don’t think they need a preloader. Just have one thumb come in at a time and then the trans preloader is loading the large image. Then the next thumb then the preload for the next large image, etc.

You are the man!

Like this?

scotty(-:

Exactly! It’s… so… beautiful… tear. There are two small bugs though. The first is that they mask doesn’t work anymore, and a weird white box comes out of nowhere (probably related to the same problem). And the other problem is that it loads a bunch of images at the same time (like 30) which kills the processing. If it could go one image at a time. First thumb then the preloader then the second thumb after the first large image is loaded, etc. that would fix it.

wow… just wow scotty.