# Resize MC transition effect

**URL:** <https://forum.kirupa.com/t/resize-mc-transition-effect/110960>\
**Category:** Uncategorized\
**Created:** [May 21, 2004, 1:17pm UTC](https://forum.kirupa.com/t/resize-mc-transition-effect/110960 "2004-05-21T13:17:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lookupthere](https://avatars.discourse-cdn.com/v4/letter/l/e99b99/32.png) [@lookupthere](https://forum.kirupa.com/u/lookupthere)\
**Post date:** [May 21, 2004, 1:17pm UTC](https://forum.kirupa.com/t/resize-mc-transition-effect/110960/1 "2004-05-21T13:17:05Z")

</div>

hi guys,

i’ve seen this stunning transition effect of resizing a MC when a button is pressed. [www.svizra.com](http://www.svizra.com). does someone know how this can be done? i’m totally curious about this effect!

thanks! lookupthere :pir:

---

<div class="post-metadata">

**Author:** ![salvador\_marley](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@salvador\_marley](https://forum.kirupa.com/u/salvador_marley)\
**Post date:** [August 17, 2004, 7:05pm UTC](https://forum.kirupa.com/t/resize-mc-transition-effect/110960/2 "2004-08-17T19:05:07Z")

</div>

This is just the thread I have been searching for.

Scotty, you helped me with my site that loaded in jpgs and it worked great. I just looked at the site that lookupthere has posted and i notice that instead of loading in jpg images, it looks as though it is loading in swf files because there are buttons within the pages.

I will look at the script in my fla’s that load in the jpg images I will see if it works with a .swf extension instead of .jpg

Thanks

---

<div class="post-metadata">

**Author:** ![salvador\_marley](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@salvador\_marley](https://forum.kirupa.com/u/salvador_marley)\
**Post date:** [August 17, 2004, 7:41pm UTC](https://forum.kirupa.com/t/resize-mc-transition-effect/110960/3 "2004-08-17T19:41:39Z")

</div>

in fact i shall post the script I have here and hope someone will recue me. As you will see I have replaced the jpg extension with swf but I notice other bits of script that refers to pics and loadpic. When i test my movie the first swf called one.swf does load in but the border doesnt work and none of the buttons work, So I feel this could work eventually with tweaking.

Anyway, here is the script on the timeline:

// array for your pictures  
picArray = new Array();  
picArray = [“one.swf”, “two.swf”, “three.swf”];  
spacing = 5;  
containerMC.\_alpha = 0;  
MovieClip.prototype.loadPic = function(pic) {  
this.\_alpha = 0;  
this.loadMovie(pic);  
this.\_parent.onEnterFrame = function() {  
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();  
var percent = Math.round((l/t)\*100);  
// added checking for height and width  
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);  
// set your loadbar width to 0 again  
loadbar.\_xscale = 0;  
delete this.onEnterFrame;  
} else {  
// show loadprogress  
loadbar.\_xscale = percent;  
}  
};  
};  
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 checking for height in case the pic has the same width  
// (statement would allwaybe true then)  
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 the pics in  
containerMC.\_alpha += 5;  
if (containerMC.\_alpha\>95) {  
containerMC.\_alpha = 100;  
delete this.onEnterFrame;  
}  
}  
};  
};  
// amount is nr of buttons  
var amount = 3;  
// loop for your buttons  
for (i=1; i\<=amount; i++) {  
but = this[“bt”+i];  
but.i = i;  
but.onRelease = function() {  
containerMC.loadPic(picArray[this.i-1]);  
};  
}  
// load the first picture in the array, change 0 if you want to start with another picture  
containerMC.loadPic(picArray[0]);  
stop();

Thank you. I wish I understood scripting 🙂

---

<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:** [August 18, 2004, 6:22am UTC](https://forum.kirupa.com/t/resize-mc-transition-effect/110960/4 "2004-08-18T06:22:41Z")

</div>

Do your swf’s have a solid (transparent) background?  
Are you sure the instancenames/paths are right?  
If so, post your .fla’s:)

scotty(-:

---

<div class="post-metadata">

**Author:** ![salvador\_marley](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@salvador\_marley](https://forum.kirupa.com/u/salvador_marley)\
**Post date:** [August 18, 2004, 11:59am UTC](https://forum.kirupa.com/t/resize-mc-transition-effect/110960/5 "2004-08-18T11:59:48Z")

</div>

scotty, I didnt use a transparent background.

The first swf now loads in fine as the page opens, all thats wrong now is that the buttons dont work.

Here is the fla files - very simple stuff - this is just an experimental file 🙂

Thank you very much for your time and help.

---

<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:** [August 18, 2004, 12:20pm UTC](https://forum.kirupa.com/t/resize-mc-transition-effect/110960/6 "2004-08-18T12:20:50Z")

</div>

There was a little mistake about the buttons. In the original code the instancenames were bt1, bt2, etc… Your instancenames are btn1, btn2, etc.  
This is how code should be:

```auto
for (i=1; i<=amount; i++) {
	but = this["btn"+i];//here you had ["bt"+i]
	but.i = i;
	but.onRelease = function() {
		containerMC.loadPic(picArray[this.i-1]);
	};
}

```

scotty(-:

---

<div class="post-metadata">

**Author:** ![salvador\_marley](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@salvador\_marley](https://forum.kirupa.com/u/salvador_marley)\
**Post date:** [August 18, 2004, 1:36pm UTC](https://forum.kirupa.com/t/resize-mc-transition-effect/110960/7 "2004-08-18T13:36:16Z")

</div>

Ah yes scotty. I’m so used to just automatically putting btn instead of bt

Thank you. It works perfect

---

<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:** [August 18, 2004, 1:55pm UTC](https://forum.kirupa.com/t/resize-mc-transition-effect/110960/8 "2004-08-18T13:55:02Z")

</div>

welcome:thumb:

---

<div class="post-metadata">

**Author:** ![josefjohny](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/josefjohny/32/708_2.png) [@josefjohny](https://forum.kirupa.com/u/josefjohny)\
**Post date:** [August 18, 2004, 6:36pm UTC](https://forum.kirupa.com/t/resize-mc-transition-effect/110960/9 "2004-08-18T18:36:38Z")

</div>

newbeeeeeee here ! Just got something similar to this. [http://www.twinphotographie.com/](http://www.twinphotographie.com/)
