External AS files

I have a body of AS that when applied to a movie clip makes it elastically follow the mouse around the screen, very nice. it looks like this:

onClipEvent (load) {
	var Mx = 0;
	var Dx = 0;
	var My = 0;
	var Dy = 0;
	//inertia has to be less then 1 and more than 0
	looseness = 0.5;
	speed = 0.3;
}
onClipEvent (enterFrame) {
	Dx = Math.round(-this._x+_root._xmouse);
	Dy = Math.round(-this._y+_root._ymouse);
	Mx = Mx*looseness + Dx*speed;
	My = My*looseness + Dy*speed;
	this._x += Mx; 
	this._y += My; 
	//trace(Mx);
}

What i want to do is turn it into a section of code that can live in an external AS file that can then be called from any point in the massive project that this is going to be used for.

What should the external AS file look like? And what should the code on the MC that is calling it look like?

I have been bumbling with it for a while, and there seems to be a crucial bit of syntax that i am not getting.

Much Appreciated.