Need help making a photo gallery

thank you so so much scotty!!! i’m gonna do that as soon as i get back to my
own computer!!! thanks!!

wecome=)

heya scotty!!! i did it!!! and it works!!! thank you so much!
there’s just one little glitch that i cannot understand…

now it loads the very first image … HUGE… and the rest then resize…
how do i make it so that it loads that first image resized already. ???

The whole code I ended up with (with all of your help!! :D) goes like this:


/*
i wrote this code, but you can use and abuse it however you like.
the methods are defined in the order which they occur to make it
easier to understand.
*/
// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. “pics/”)
// leave it blank if they’re in the same directory
this.pathToPics = “DerbyDaysDinnerSpring04/”;
// fill this array with your pics
this.pArray = [“image1.jpg”, “image2.jpg”, “image3.jpg”, “image4.jpg”, “image5.jpg”, “image6.jpg”, “image7.jpg”, “image8.jpg”];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l && this.photo._width>0 && this.photo._height>0) {
//change the “25” to the value you want
this.photo._xscale = this.photo._yscale=25;
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
// Actions -----------------------------------------
// these aren’t necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);


Help ?? Thank you so much!!!

I see:)
Look for this line in your code

loadMovie(this.pathToPics+this.pArray[0], _root.photo);

This loading the first picture, but directly, without the use of the fade in and thus without the resizing…
Skip that line and put at the bottom of your code:

this.changePhoto(0)

scotty(-:

you are a total GODSEND!!! THANK YOU SOOOOOOOOOOOOO MUCH.
soon as i put this online i’ll post the link so you can see how i did :slight_smile:
THANK YOU THANK YOU THANK YOU

no problem:lol: