Dynamic resize issue: resize from corner, not center

Okay. So I just got this little slide show I’m doing to load the next image (i’m still working on making it loop, so if anyone wants to help me with that, too feel free!) :slight_smile:

As each new picture is loaded in the slideshow, I have a border that automatically resizes to fit it. Right now it’s resizing from the center, is there any way to make it expand out from the top right corner instead of the center (since the orientation of the pictures are different, it looks a bit unnatural for what I’m doing)

Here is the code for my actions layer and if anyone can take a look and tell me what I need to change/add to make this work, I appreciate it!! :smiley:

#include "mc_tween2.as"
space = 10;
photo_mc._alpha = 0;
MovieClip.prototype.loadPhoto = function(photo){
 photo_mc._alpha = 0;
 this.loadMovie(photo);
 _level0.onEnterFrame = function(){
  // modified the total and loaded so as to round it up
  // to smaller number.
  var total = Math.round(photo_mc.getBytesTotal()/1024);
  var loaded = Math.round(photo_mc.getBytesLoaded()/1024);
  if (total != 0 && loaded>=total){
   var w = photo_mc._width + space;
   var h = photo_mc._height + space;
   border.resize(w, h);
   delete this.onEnterFrame;
  }
 }
};
MovieClip.prototype.resize = function(w, h){
 //the higher the slower the resize of the border
 var speed = 6;
 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;
   photo_mc._x = this._x - this._width/2 + space/2;
   photo_mc._y = this._y - this._height/2 + space/2;
   photo_mc.alphaTo (100, 0.5, "linear")
   delete this.onEnterFrame;
  }
 }
};
image_mc.onLoad = setInterval( nextImage, 7*1000 )
;

-SD