# Resize Border

**URL:** https://forum.kirupa.com/t/resize-border/276248
**Category:** flash
**Created:** [November 24, 2008, 10:57pm UTC](https://forum.kirupa.com/t/resize-border/276248 "2008-11-24T22:57:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![fivepoints](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fivepoints](https://forum.kirupa.com/u/fivepoints)
#### Post date: [November 24, 2008, 10:57pm UTC](https://forum.kirupa.com/t/resize-border/276248/1 "2008-11-24T22:57:35Z")

</div>

//------------Resize Border----------//  
spacing = 10;  
this.\_parent.containerMC.\_alpha = 0;  
MovieClip.prototype.loadPic = function(pic) {  
this.\_parent.containerMC.\_alpha = 0;  
this.\_parent.containerMC.loadMovie(pic);  
this.\_parent.onEnterFrame = function() {  
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();  
if (t != 0 && Math.round(l/t) == 1) {  
var w = containerMC.\_width+spacing, h = containerMC.\_height+spacing;  
border.resizeMe(w, h);  
delete this.\_parent.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;  
this.containerMC.\_x = this.\_x-this.\_width/2+spacing/2;  
this.containerMC.\_y = this.\_y-this.\_height/2+spacing/2;  
this.\_parent.containerMC.\_alpha = 100;  
delete this.onEnterFrame;  
}  
};  
};  
contentHolder2.content1.but8.onRelease = function() {  
containerMC.loadPic(“pic1.jpg”);  
};  
contentHolder2.content1.but9.onRelease = function() {  
containerMC.loadPic(“pic2.jpg”);  
};
