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]