THUMBNAILS and their amount on the page


I’d like to know how the thing, that I am now going to explain on the site [COLOR=Navy][/COLOR], is made.
There is a several amount of thumbnails. Their number depends on the screen resolution or on the size of the window.
Anytime the screen resolution or the size of the window get smaller, the amount of those thumbnails gets smaller, too and the rest of them
moves to the other page, therefore you have to keep clicking button “next” to see all of them (thumbnails)
at the end. The question is, how this all is made. Thank you very much for any possible help. I will appreciate it.

To do this you’ll need to add a listener to your stage.

This piece of code goes on the first frame of your movie:

Stage.align = "TL";
Stage.scaleMode = "noScale";
Stage.showMenu = false;

this.onResize = function(){
	alignBottom._x = Stage.width - 10;
	alignBottom._y = Stage.height - 10;
	contentMC._x = Stage.width/2 - 406;
	contentMC._y = Stage.height/2 - 178;
	loaderMC._x = Stage.width/2;
	loaderMC._y = Stage.height/2 + 25;
	/* Testing purposes */
	/* traceArray = new Array("alignBottom", "contentMC");
	for(i=0; i<traceArray.length; i++){
		trace(traceArray* + " X value: " + traceArray*._x);
		trace(traceArray* + " Y value: " + traceArray*._y);
	} */


I used this code for a project of mine, so it has not been adapted for your needs :slight_smile: But be sure to look into the Stage.width and Stage.height functions and then divide them by the width and height of the thumbnails.

I don’t think that that’s what I’m asking about. I mean the amount of thumbnails not their location. For example with the screen resolution 1280x1024 thirty thumbnails show up on the page. And with the screen resolution 1024x768 just twelve thumbnails show up on the page. This same effect happens also with the size change of the window. I also think that the thumbnails are loaded by xml.

Well… like I said. Look into Stage.width and Stage.height.

this.onResize = function(){
// See how many clips are supposed to be on the stage. (clip size is 40 by 40 for instance)
var nrOfClipsHorizontally:Number = Stage.width / 50; // Leaves 10 pixels spacing in between.
var nrOfClipsVertically:Number = Stage.height / 50;

// Attach and position the clips.
var totalClips = nrOfClipsHorizontally * nrOfClipsVertically;

// Create a loop
for(i=0; i < totalClips; i++){
// some more code I can’t really write on the fly.


Thank you really much for this one! The thing is that I don’t have anything done yet, I’ve only seen that site and I really like it, so I wanted to do it. May I ask you to make some sample for me, please? I would really appreciate it!

Could somebody help me to put that together somehow? I’ve been trying to do it the whole afternoon, but no way…Please, thank you.