Resize width and height

Hi guys,

I have a container, which resize in the width, because i just want to change the width of the container in the gallery.
But I want to use the same container for other stuff, so that the container should resize in height and width.

Here the code for resizing width.


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+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) {
                container._alpha = 100;
                delete this.onEnterFrame;
            }
        }
    };
};

So it takes the pictures and resize the container. The pictures all have the same height.
Now I want to load a textfield for example:
I’m calling the container like that : container.resizeMe(309, 278);

So the container should now change the width and (then) the height.
The point is, that it’ll not start at the same x- and y-point like it did before for changing the picturesize.

Do you have an idea?

cheers
froesi