# Debug help plz

**URL:** https://forum.kirupa.com/t/debug-help-plz/70757
**Category:** Uncategorized
**Created:** [November 17, 2004, 8:47am UTC](https://forum.kirupa.com/t/debug-help-plz/70757 "2004-11-17T08:47:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![VoS](https://avatars.discourse-cdn.com/v4/letter/v/22d042/32.png) [@VoS](https://forum.kirupa.com/u/VoS)
#### Post date: [November 17, 2004, 8:47am UTC](https://forum.kirupa.com/t/debug-help-plz/70757/1 "2004-11-17T08:47:11Z")

</div>

ive got a code for a small ball to follow the mouse

```auto

onClipEvent (enterFrame) {
dtx=this._x
dty=this._y
distX=_xmouse-dtx;
distY=_ymouse-dty;
if(distX<0){
	distX=distX*-1;
}
if(distY<0){
	distY=distY*-1;
}
total=(distX+distY);
//trace("total "+total);
partX=distX/total;
partY=distY/total;
//hittest
if(distX<10 and distY<10){
	_root.textbox.text="boom";
	stop();
}
if(_xmouse>this._x){
	dtx=dtx+(partX*10);
}else{
	dtx=dtx-(partX*10);
}
if(_ymouse>this._y){
	dty=dty+(partY*10);
}else{
	dty=dty-(partY*10);
}
this._x=dtx;
this._y=dty;
}

```

but it does not work , the ball stops a bit aways from the mouse  
however,  
if i put the code in the timeline and replace all the this statements with the movieclip instance name it works … help plz 😉
