# Lines follow cursor

**URL:** <https://forum.kirupa.com/t/lines-follow-cursor/156251>\
**Category:** Uncategorized\
**Created:** [July 24, 2005, 9:55am UTC](https://forum.kirupa.com/t/lines-follow-cursor/156251 "2005-07-24T09:55:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![crtvgrndwrks](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@crtvgrndwrks](https://forum.kirupa.com/u/crtvgrndwrks)\
**Post date:** [July 24, 2005, 9:55am UTC](https://forum.kirupa.com/t/lines-follow-cursor/156251/1 "2005-07-24T09:55:52Z")

</div>

some of you have probably seen something like this on experimental websites… i got bored and decided to see if i could come up with it. here’s the link and the code:

[http://creativegroundworks.com/stuff/pointToCursor.swf](http://creativegroundworks.com/stuff/pointToCursor.swf)

```auto
height = 5;
width = 5;
spacing = 100;
counter = 0;
this.onMouseMove = function() {
	counter = 0;
	for(i=0;i<width;i++) {
		for(j=0;j<height;j++) {
			counter++;
			movieName = counter+"_mc";
			this.createEmptyMovieClip(movieName,counter+100);
			this[movieName].lineStyle(1,0xff0000,100);
			this[movieName].moveTo(i*spacing,j*spacing);
			this[movieName].lineTo((_xmouse+i*spacing)/2,(_ymouse+j*spacing)/2);
		}
	}
}

```
