Mulitple shakes

I got this code which makes and movieclip named box shake when the mouse comes close to it…

I want more than one box to shake yet I can’t make it happen by adding the script to each new movieclip and changing the script and naming the objects differently?

Have a go and see if anyone can help me!!!

Cheers!

postatomic

Post your code, it’ll make it easier for everyone to help you. I’m sure someone on the board can help you.

Kyle
<:}

yeah that would help wouldn’t it…

startx=box._x;
starty=box._y;
MovieClip.prototype.shakeYourBody=function(radius){
forceX=2*(Math.random()-.5)radius;
forceY=2
(Math.random()-.5)*radius;
this._x=startx+forceX;
this._y=starty+forceY;
}

this.onEnterFrame=function(){
// Find distance
var dx=_xmouse-box._x;
var dy=_ymouse-box._y;
var distance=dxdx+dydy;
box.shakeYourBody(100000/(distance+10));
}

thanks!