This is the souce code for loading and resizing the images from an xml page. The rectangle is autimatically resizing as per the size of the image. But the problem is, in 800 x 600 resolution with small images the rectagle goes down 'coz it resizing happening in aspect ratio (width and height is proportionally changed). I want to change the height and width only downward direction. Top left corner should be fixed. How to alter this code for that.
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;
}
}
};
};