Please take a look at the following link and click on the Gallery Link. Once your in the gallery, click the first gallery link “Project - 1”. The gallery page will load and then click on the thumbs.
Are the images showing up out of center? I’m having intermitent problems with the images not coming in the right place. Then if you click on one for a second time it may show up in the right place???
Below is the code used to load the images… it was from a tutorial… I don’t see how it doesn’t work correctly. If someone could help me it would be great.
http://www.wheatley-design.com/goshen/goshen4.html
spacing = 10;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic){
_root.containerMC._alpha = 0;
this.loadMovie(pic);
_root.onEnterFrame = function(){
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1){
var w = containerMC._width + spacing, h = containerMC._height + spacing;
border.resizeMe(w, h);
delete _root.onEnterFrame;
}
}
};
MovieClip.prototype.resizeMe = function(w, h){
var speed = 3;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1){
this._width = w;
this._height = h;
_root.containerMC._x = this._x - this._width/2 + spacing/2;
_root.containerMC._y = this._y - this._height/2 + spacing/2;
_root.containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};
anyone with any ideas? I really don’t understand why it doesnt work, but then it will…??
Hi wheatleyweb,
I am not that familiar with the famous resize gallery (I changed mine to a nonresize one ;)) but I remember the issue came up in the resize thread. Maybe do a search there … if I recall: Scotty said it has to do with the image has to be fully loaded (so flash/the script can center the image and then the resize has to accure)!
Let me see if I can find the thread …
Still looking … But in one of my old resize V3_thumbs I found this:
MovieClip.prototype.loadPic = function(pic, id) {
info.text = "";
this._alpha = 0;
this.loadMovie(pic);
temp = this._parent.createEmptyMovieClip("temp2", 998);
temp.onEnterFrame = function() {
var t = container.getBytesTotal(), l = container.getBytesLoaded();
if (Math.round(l/t) == 1 && container._width != 0 && container._height != 0) {
var w = container._width+spacing, h = container._height+spacing;
border.resizeMe(w, h, id);
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.resizeMe = function(w, h, id) {
var speed = 3;
container._alpha = 0;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
container._x = this._x-this._width/2+spacing/2;
container._y = this._y-this._height/2+spacing/2;
info._y = Math.round(this._y+this._height/2+spacing/2);
container._alpha += 5;
if (container._alpha>90) {
info.text = id;
container._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
… your code is missing “id” (without quotations) …
Which version of the resize .fla are you using?
thanks for posting…
im not sure what version it is. it is attached to the post.
The problem is that this code is beyond me, so I cannot tell exactly what does what.
I agree that it seems like it only does it while the images are not fully loaded. Not sure how to make it preload those external images.
flashwillkill - i just input your code into my project and it works… but the first thumb will not work??? its the same code as the rest of them, but it just does nothing… lol
im loosing my mind
im loosing my mind
… Then you are not the first and 300% sure not the last, but don’t. You need to read the thread (geeh, I know … its getting longer everyday), play around with the different files and ask if things are unclear.
People usually help
OK, enough …
Your posted fla is one of those that use the loadPic=function(pic) (there are about 3 trillion versions of the gallery around here).
Forget what I posted before, use whats at the bottom. The loadPic function preloads the images. Its the
if (t != 0 && Math.round(l/t) == 1 && containerMC._width != 0) {
that checks if the image is loaded and then resizes the content.
You can add a MC, name it bar and a dynamic textfield, name it loadText, and you can see the preloading.
It’s also explained from the “Master” himself here (#80).
The added
containerMC.loadPic("pic1.jpg");
at the end of the script loads the first image when you enter the gallery 
Hope it works (haven’t tested it online)?
spacing = 10;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic) {
containerMC._alpha = 0;
this.loadMovie(pic);
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
bar._visible = 1;
per = Math.round((l/t)*100);
if (t != 0 && Math.round(l/t) == 1 && containerMC._width != 0) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h);
bar._visible = 0;
loadText.text = "";
delete this._parent.onEnterFrame;
} else {
bar._width = per;//gives the bar a max width 100
loadText.text = per+" % loaded";
}
};
};
MovieClip.prototype.resizeMe = function(w, h) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1) {
this._width = w;
this._height = h;
_root.containerMC._x = this._x-this._width/2+spacing/2;
_root.containerMC._y = this._y-this._height/2+spacing/2;
_root.containerMC._alpha += 5;
if (_root.containerMC._alpha>90) {
_root.containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
containerMC.loadPic("pic1.jpg");
works wonderfully man… thanks for the help… i did read the post and all of this was helpful
do me a favor though and check the link and make sure it works correctly for you…
http://www.wheatley-design.com/goshen/goshen4.html
thanks flashwillkill
i got my mind back 
Glad it worked and of course that you got your mind back!
Checked http://www.wheatley-design.com/goshen/goshen4.html and yes, works for me.
If you are still looking for feedback, I could not resist posting what I have noticed =)