Function help please

Hi Im trying to wright a moveit function that has the parameters of (theClip,targetx,axis,num).

theClip is the mc name.
targetx is the mc destination.
axis is the mc _x or _y axis.
num is either a frame number or label

here is the code //

function moveit (theClip,targetx,axis,num){
theclip.onEnterFrame =function(){
var distance = this.targetx - this.axis;
theClip.axis += distance / 2;
}
if(theClip.axis == targetx -1){
_root.gotoAndStop(num);
delete theClip.onEnterFrame;
}
}

ref it with //moveit(box,150,_y,test);

I thought it should work, but i carn’t figure it out please help i’ve attached the fla file thank you.