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

**URL:** <https://forum.kirupa.com/t/scottys-image-resize-gallyery-revisited-not-quite-working/186862>\
**Category:** flash\
**Created:** [April 25, 2006, 2:26am UTC](https://forum.kirupa.com/t/scottys-image-resize-gallyery-revisited-not-quite-working/186862 "2006-04-25T02:26:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![broD](https://avatars.discourse-cdn.com/v4/letter/b/2acd7d/32.png) [@broD](https://forum.kirupa.com/u/broD)\
**Post date:** [April 25, 2006, 2:26am UTC](https://forum.kirupa.com/t/scottys-image-resize-gallyery-revisited-not-quite-working/186862/1 "2006-04-25T02:26:01Z")

</div>

Hello,

I am trying to get a flash gallery with resizing border working properly. I started at [actionscript.org](http://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's Image Resize Gallery](https://www.kirupa.com/forum/showthread.php?t=87388)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

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](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

---

<div class="post-metadata">

**Author:** ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)\
**Post date:** [April 25, 2006, 7:36am UTC](https://forum.kirupa.com/t/scottys-image-resize-gallyery-revisited-not-quite-working/186862/2 "2006-04-25T07:36:23Z")

</div>

Change the resizeMe and loadPic functions like this

```auto
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(-:

---

<div class="post-metadata">

**Author:** ![broD](https://avatars.discourse-cdn.com/v4/letter/b/2acd7d/32.png) [@broD](https://forum.kirupa.com/u/broD)\
**Post date:** [April 25, 2006, 8:14pm UTC](https://forum.kirupa.com/t/scottys-image-resize-gallyery-revisited-not-quite-working/186862/3 "2006-04-25T20:14:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)\
**Post date:** [April 26, 2006, 4:51am UTC](https://forum.kirupa.com/t/scottys-image-resize-gallyery-revisited-not-quite-working/186862/4 "2006-04-26T04:51:04Z")

</div>

> 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(-:
