# I cannot finish this function

**URL:** <https://forum.kirupa.com/t/i-cannot-finish-this-function/55544>\
**Category:** flash\
**Created:** [June 24, 2004, 11:18pm UTC](https://forum.kirupa.com/t/i-cannot-finish-this-function/55544 "2004-06-24T23:18:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![El\_Bicho](https://avatars.discourse-cdn.com/v4/letter/e/dbc845/32.png) [@El\_Bicho](https://forum.kirupa.com/u/El_Bicho)\
**Post date:** [June 24, 2004, 11:18pm UTC](https://forum.kirupa.com/t/i-cannot-finish-this-function/55544/1 "2004-06-24T23:18:50Z")

</div>

I have several MC that move downwards. They all start with the same \_y value and when they reach the “floor” I want them to go 20 pixels down all toghether with a continuous move. I’m stucked with this last action.

This is the code I have

```auto

Movieclip.prototype.bounce = function(factor, posFinal, ratio) {
	this.onEnterFrame = function() {
		cont++;
		this._y++;
		if (cont>142) {
			this.yPos = this.yPos*factor+(posFinal-this._y)*ratio;
			this._y += this.yPos;
			if (Math.abs(this._y-posFinal)<.1) {
				delete this.onEnterFrame;
				this._y = posFinal;
			}
		}
	};
};
clip1.bounce(.7, 300, .55);
clip2.bounce(.7, 300, .5);
clip3.bounce(.7, 300, .455);
clip4.bounce(.7, 300, .40);

```

So far, all the ways I tried make the MCs go 20 pixels down but not all at the same time.

Thanks.
