# \[flash 8\]Adapting 'Auto trace mouse' script to perfom 'Atuo trace object'

**URL:** <https://forum.kirupa.com/t/flash-8-adapting-auto-trace-mouse-script-to-perfom-atuo-trace-object/181087>\
**Category:** flash\
**Created:** [March 6, 2006, 11:36am UTC](https://forum.kirupa.com/t/flash-8-adapting-auto-trace-mouse-script-to-perfom-atuo-trace-object/181087 "2006-03-06T11:36:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmokwete](https://avatars.discourse-cdn.com/v4/letter/k/e0b2c6/32.png) [@kmokwete](https://forum.kirupa.com/u/kmokwete)\
**Post date:** [March 6, 2006, 11:36am UTC](https://forum.kirupa.com/t/flash-8-adapting-auto-trace-mouse-script-to-perfom-atuo-trace-object/181087/1 "2006-03-06T11:36:38Z")

</div>

Hello everyone…

I am new to flash and I am hoping the good people of this forum will help:).  
I have this sript for auto tracing a mouse position (got from this site) but i would like intead of trcing the mouse…to get it to trace a random moving object from another script!

mouse script:

[COLOR=Blue]createEmptyMovieClip(“Line”,1);  
Line.lineStyle(1,0x000000,100);  
onMouseDown = function ()  
{  
Line.moveTo(\_xmouse, \_ymouse);  
onMouseMove = function ()  
{ Line.lineTo(\_xmouse, \_ymouse);}  
}

onMouseUp=function()  
{  
onMouseMove=null;  
}  
[/COLOR]  
Random moving object:  
[COLOR=Red]  
loops = 0;  
\_root.target\_x = Math.random()\*450;  
\_root.target\_y = Math.random()\*300;  
\_root.xdiv = (\_root.target\_x-\_root.circle.\_x)/20;  
\_root.ydiv = (\_root.target\_y-\_root.circle.\_y)/20;  
loops++;  
\_root.circle.\_x += \_root.xdiv;  
\_root.circle.\_y += \_root.ydiv;  
loops++;  
\_root.circle.\_x += \_root.xdiv;  
\_root.circle.\_y += \_root.ydiv;  
if (loops\<20) {  
gotoAndPlay(2);  
} else {  
gotoAndPlay(1);  
}

[COLOR=Black]I guess there is a way I can do this or it can be done…? Help will be much appreciated.

Thankz

[/COLOR][/COLOR]
