# Problems with photo gallery tutorial

**URL:** https://forum.kirupa.com/t/problems-with-photo-gallery-tutorial/97287
**Category:** Uncategorized
**Created:** [December 19, 2003, 10:21pm UTC](https://forum.kirupa.com/t/problems-with-photo-gallery-tutorial/97287 "2003-12-19T22:21:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![onestepaway](https://avatars.discourse-cdn.com/v4/letter/o/e8c25b/32.png) [@onestepaway](https://forum.kirupa.com/u/onestepaway)
#### Post date: [December 19, 2003, 10:21pm UTC](https://forum.kirupa.com/t/problems-with-photo-gallery-tutorial/97287/1 "2003-12-19T22:21:11Z")

</div>

I got the photo gallery to work, but the photos appear in the lower right hand corner of my animation, i have been trying to figure out why for quite some time now, so now i give up and ask if anyone can tell me why, and what i need to change to get the photos to load in the center of the movie i specified. I did everything just like in the tutorial, i used the same code, except for changing the images to load. The fla is attached if needed, and here is the code i used:

this.pathToPics = “”;  
this.pArray = [“scarlet1.jpg”, “scarlet2.jpg”, “scarlet3.jpg”];  
this.fadeSpeed = 20;  
this.pIndex = 0;  
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() {  
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.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;  
}  
};  
this.onKeyDown = function() {  
if (Key.getCode() == Key.LEFT) {  
this.changePhoto(-1);  
} else if (Key.getCode() == Key.RIGHT) {  
this.changePhoto(1);  
}  
};  
Key.addListener(this);

Any help would be much appreciated. Thanks a lot!
