Scotty's Image Resize Gallyery...Revisited / Not Quite Working

Hello,

I am trying to get a flash gallery with resizing border working properly. I started at actionscript.org with FlashGuru’s onLoad.data workaround however I noticed immediatedly that I was getting Error 256 messages constantly when I would reload the .swf. After a little more searching I came to this post.

Scotty, Stringy, DDD, senocular and all you other wonderful folk I appreciate the thoroughness of the thread. However I still cannot get my image gallery to function properly. It works flawlessly off of my harddrive does not function properly once posted to my server. I am thinking its because of filesize, in which case I am at a loss for a workaround. Please visit the below link to see the problem in action.

http://www.andrewfillmore.com/Final_Andrew_MX.html

The images are anywhere from 30-50k.

I have attached an .fla that contains everything minus most of the graphics. The growing function is the first actions layer and my code resides on the second layer.

All suggestions / thoughts would be greatfully appreciated and those that find a solution wil be added to my will.

broD

Change the resizeMe and loadPic functions like this

spacing = 10;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic) {
	containerMC._alpha = 0;
	trace("functionCalled");
	this.loadMovie(pic);
	var temp = this._parent.createEmptyMovieClip("tem", 99);
	temp.onEnterFrame = function() {
		if (containerMC._width) {
			var w = containerMC._width+spacing, h = containerMC._height+spacing;
			border.resizeMe(w, h);
			delete this.onEnterFrame;
		}
	};
};
MovieClip.prototype.resizeMe = function(w, h) {
	border._visible = true;
	var speed = 10;
	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;
			containerMC._x = this._x-this._width/2+spacing/2;
			containerMC._y = this._y-this._height/2+spacing/2;
			//Fade in of image
			containerMC._alpha += 10;
			if (containerMC._alpha>100) {
				containerMC._alpha = 100;
				delete this.onEnterFrame;
			}
		}
	};
};

btw welcome to kirupaforums =)

scotty(-:

Thank you Scotty you saved my a#%. My friend loves it and it works beautifully. I am still unfamiliar with prototypes / classes etc but can kinda see how this works. Just curious though

if(containerMC._width)…I am assuming that this is just checking to see if the empty movie clip has any _width at all meaning a picture has been loaded?

delete this.onEnterFrame? Is this referencing the function call or the whole MovieClip.prototype

Again.Wonderful.ThankYou.

broD

if(containerMC._width)…I am assuming that this is just checking to see if the empty movie clip has any _width at all meaning a picture has been loaded?

Yep

delete this.onEnterFrame? Is this referencing the function call or the whole MovieClip.prototype

The ‘this’ refers to the mc that called the function, it’s a good habit to save resources:)

scotty(-: