# Resizing gallery issue

**URL:** <https://forum.kirupa.com/t/resizing-gallery-issue/57709>\
**Category:** Uncategorized\
**Created:** [July 15, 2004, 2:36pm UTC](https://forum.kirupa.com/t/resizing-gallery-issue/57709 "2004-07-15T14:36:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielthelion](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@danielthelion](https://forum.kirupa.com/u/danielthelion)\
**Post date:** [July 15, 2004, 2:36pm UTC](https://forum.kirupa.com/t/resizing-gallery-issue/57709/1 "2004-07-15T14:36:55Z")

</div>

hey guys, could you all check out [www.creativejuggernauts.com](http://www.creativejuggernauts.com)  
and go to the print section and then check out the print pieces. for some reason my resizing gallery movie is doing some weird stuff and i cant figure out how to fix it. my actionscript goes like this :

stop();

spacing = 20;  
galleryMC.\_alpha = 0;

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 15, 2004, 4:30pm UTC](https://forum.kirupa.com/t/resizing-gallery-issue/57709/2 "2004-07-15T16:30:21Z")

</div>

anyone? can anyone help me with this?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 15, 2004, 7:00pm UTC](https://forum.kirupa.com/t/resizing-gallery-issue/57709/3 "2004-07-15T19:00:09Z")

</div>

What’s the “emptyMC”?  
If you load your pictures in “galleryMC”, this code will work, replace “containerMC” with “galleryMC”😉

```auto
spacing = 10;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic) {
        _root.containerMC._alpha = 0;
        this.loadMovie(pic);
        this._parent.onEnterFrame = function() {
                var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
                //added checking for width and height 
                if (t != 0 && Math.round(l/t) == 1 && containerMC._width>0 && containerMC._height>0) {
                        var w = containerMC._width+spacing, h = containerMC._height+spacing;
                        border.resizeMe(w, h);
                        delete this.onEnterFrame;
                }
        };
};
MovieClip.prototype.resizeMe = function(w, h) {
        var speed = 3;
        this.onEnterFrame = function() {
                this._width += (w-this._width)/speed;
                this._height += (h-this._height)/speed;
                //added height here in case only the height differs
                if (Math.abs(this._width-w)<1 && Math.abs(this.height-h)<1) {
                        this._width = w;
                        this._height = h;
                        _root.containerMC._x = this._x-this._width/2+spacing/2;
                        _root.containerMC._y = this._y-this._height/2+spacing/2;
                        _root.containerMC._alpha += 5;
                        if (_root.containerMC._alpha>90) {
                                _root.containerMC._alpha = 100;
                                delete this.onEnterFrame;
                        } 
				}
		}
}

```

scotty(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 15, 2004, 8:24pm UTC](https://forum.kirupa.com/t/resizing-gallery-issue/57709/4 "2004-07-15T20:24:45Z")

</div>

hey scotty, thanks, i tried your code out but in the end i figured out what my problem was…as always, paths…i appreciate your assistance.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 15, 2004, 8:39pm UTC](https://forum.kirupa.com/t/resizing-gallery-issue/57709/5 "2004-07-15T20:39:56Z")

</div>

no problem:)  
Glad you’ve found it out!

scotty(-:
