# Bouncing size

**URL:** <https://forum.kirupa.com/t/bouncing-size/5731>\
**Category:** flash\
**Created:** [September 20, 2002, 1:55pm UTC](https://forum.kirupa.com/t/bouncing-size/5731 "2002-09-20T13:55:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbie22](https://avatars.discourse-cdn.com/v4/letter/n/c6cbf5/32.png) [@newbie22](https://forum.kirupa.com/u/newbie22)\
**Post date:** [September 20, 2002, 1:55pm UTC](https://forum.kirupa.com/t/bouncing-size/5731/1 "2002-09-20T13:55:36Z")

</div>

Hi guys!

I was thinking on how to make a dinamic scalalable Mc with some kind of bouncing… Come on! we all have seen this somewhere, but I´m new in Actionscript, so I bet I could do it with a llitle help from my friends:P

I would like to trigger the new size from a button, I hope this helps!

---

<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:** [September 20, 2002, 7:41pm UTC](https://forum.kirupa.com/t/bouncing-size/5731/2 "2002-09-20T19:41:06Z")

</div>

what kinda bouncing?  
something like my footer? (drag the circle)

---

<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:** [September 20, 2002, 7:44pm UTC](https://forum.kirupa.com/t/bouncing-size/5731/3 "2002-09-20T19:44:00Z")

</div>

If you have a clip called _square_ on the scene, you can try this code on the first frame of the movie:

```auto
inertia=.6;
k=.2;
function elastic (val){
	var ds=val-this._yscale;
	this.speed=this.speed*inertia+ds*k;
	this._xscale+=this.speed;
	this._yscale+=this.speed;
}
square.onRollOver=function(){
	this.onEnterFrame=function(){
		elastic(150);
	}
}
square.onRollOut=function(){
	this.onEnterFrame=function(){
		elastic(100);
	}
}

```

It’s Flash MX by the way. But the principle is explained on the springs tutorial on this site.

pom :asian:
