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
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.