Problem loading pics into right position

I have posted numerous times learning new things to get my photo gallery working and i’m almost done, but i still have one problem. I have been trying to find out how to load the photos into the center of a movie from the center of the photos. I just got this code which makes the photos load directly into the center of the stage, but i was wondering if there is code to load the movies directly into a certain movie clip. At the bottom is the new code that i just got, and the file is also attached if anyone would like to look at that and help me out. I want to get the photos so that when they load they appear in the center of the cone movie clip.

var absX = Stage.width/2.;
var absY = Stage.height/2.;
this.pathToPics = “”;
this.pArray = [“scarlet1.jpg”, “scarlet2.jpg”, “scarlet3.jpg”];
this.fadeSpeed = 20;
this.pIndex = 0;
//loading en setting x/y for first picture
loadMovie(this.pathToPics+this.pArray[0], this.photo);
this.photo._x = absX-276;//first picture = 178 width/2
this.photo._y = absY-238;//first picture = 277 height/2
MovieClip.prototype.changePhoto = function(d) {
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 = this.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;
this.photo._x = absX-this.photo._width/2;
this.photo._y = absY-this.photo._height/2;
} 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
-Ryan.

here’s the file

I haven’t had a good look at your fla yet (need to make some dummy scarlet images) but try moving the registration point of your “photo” instance to the top left hand corner then repositioning it on the stage. The top left hand corner of loaded clips align the with registration point of the target clip or the top left of the stage (if it is loaded into a level instead of a target clip).

onestepaway, is this your way of working??
Starting a thread (yesterday), getting an answer, deleting it and start another thread (which continued on the answer I gave you)?

Yesterday was the last time I helped you

scotty:m:

*Originally posted by scotty *
**
Yesterday was the last time I helped you

scotty:m: **

onestepaway, i think he’s mad.

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=42907