Preloader for image-resize gallery

Hey, great forums, you guys sure know your stuff around here. I currently have a bit of a problem, i’m trying to create an image-resize gallery with a preloader. This is currently what it looks like:

containerMC
button1

Actionscript on frame1

spacing = 10;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function (pic)
{
	containerMC._alpha = 0;
	this.loadMovie(pic);
	onEnterFrame = function ()
	{
		var t = containerMC.getBytesTotal();
		var l = containerMC.getBytesLoaded();
		if (t != 0 && Math.round(l / t) == 1 && containerMC._width > 2)
		{
			var w = containerMC._width + spacing;
			var h = containerMC._height + spacing;
			border.resizeMe(w, h);
			delete onEnterFrame;
		} // end if
	};
};
MovieClip.prototype.resizeMe = function (w, h)
{
	var speed = 3;
	this.onEnterFrame = function ()
	{
		this._width = this._width + (w - this._width) / speed;
		this._height = this._height + (h - this._height) / speed;
		if (Math.abs(this._width - w) < 1)
		{
			this._width = w;
			this._height = h;
			containerMC._x = this._x - this._width / 2 + spacing / 2;
			containerMC._y = this._y - this._height / 2 + spacing / 2;
			containerMC._alpha = containerMC._alpha + 9;
			if (containerMC._alpha > 90)
			{
				containerMC._alpha = 100;
				delete this.onEnterFrame;
			} // end if
		} // end if
	};
};

and on button1 i have

on (release)
{
	containerMC.loadPic("image.jpg");
}

I was just wondering if anyone knew an easy way of setting a preloader of some sort to load the .jpg and then resizes?

Cheers for taking the time to read my post :slight_smile: