Hi there, I am building an xml gallery for my portfolio site. I have preview images that are all set to the same size when a thumbnail is clicked, no problem there. The problem I am running into is that when I want to enlarge the images they are all different sizes so I am trying to combine the classic xml gallery tutorial (what I used for all the preset sizes) here and some of Scotty’s resize image code (for the enlarged pics that will be different sizes. As I am trying to do this the codes are not working in harmony. Can you help me out here?
Here is the important part of the code I use for the preset images:
this.onEnterFrame = function() {
trace("picture onEnterFrame")
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
bar._visible = true;
if (loaded != filesize) {
bar._xscale = 100*(loaded/filesize);
} else {
bar._visible = false;
if (picture._alpha<100) {
picture._alpha += 8;
}
}
}
};
This is the code for the image resizing and enlarging:
MovieClip.prototype.loadPic = function(pic) {
cur = pic;
containerMC._alpha = 0;
this.loadMovie(image[pic]);
this._parent.onEnterFrame = function() {
trace("parent containerMC");
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
barxl._visible = true;
per = Math.round((l/t)*100);
if (t != 0 && Math.round(l/t) == 1 && containerMC._height != 0) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h);
barxl._visible = false;
delete this.onEnterFrame;
trace("containerMC");
} else {
barxl._xscale = per;
}
};
};
MovieClip.prototype.resizeMe = function(w, h) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
// this is where i'm trying to code the repositioning of the caption
picinfo._y = border._y+244;
picinfo._x = border._x-148;
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1)
if (Math.abs(this._width-w)<1) {
this._width = w;
this._height = h;
containerMC._x = this._x-this._width/2;
containerMC._y = this._y-this._height/2+40;
containerMC._alpha += 5;
if (containerMC._alpha>90) {
containerMC._alpha = 100;
trace("resizeMe");
delete this.onEnterFrame;
}
}
};
};
The preset images load in fine until one of the enlarged images are clicked then, then the code for the preset images is ineffective. I’m pretty sure it has to do with the onEnterFrame, but I’m still getting my grips so I’m not exactly sure what its doin. Any suggestions?