# How to make two lines snap to your mouse cursor?

**URL:** <https://forum.kirupa.com/t/how-to-make-two-lines-snap-to-your-mouse-cursor/28531>\
**Category:** flash\
**Created:** [August 14, 2003, 6:41pm UTC](https://forum.kirupa.com/t/how-to-make-two-lines-snap-to-your-mouse-cursor/28531 "2003-08-14T18:41:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lun](https://avatars.discourse-cdn.com/v4/letter/l/e5b9ba/32.png) [@Lun](https://forum.kirupa.com/u/Lun)\
**Post date:** [August 14, 2003, 6:41pm UTC](https://forum.kirupa.com/t/how-to-make-two-lines-snap-to-your-mouse-cursor/28531/1 "2003-08-14T18:41:29Z")

</div>

How to make two lines snap to your mouse cursor?  
Example: [http://www.kirupa.com/developer/mx/specialfx.htm](http://www.kirupa.com/developer/mx/specialfx.htm)  
the flash file on the top ( small one )

Can anyone teach me and provide me with the code?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 14, 2003, 6:55pm UTC](https://forum.kirupa.com/t/how-to-make-two-lines-snap-to-your-mouse-cursor/28531/2 "2003-08-14T18:55:15Z")

</div>

the crosshair? This should help you: [http://www.flashkit.com/movies/Games/Skeet\_Sh-Jobe\_Mak-1043/index.php](http://www.flashkit.com/movies/Games/Skeet_Sh-Jobe_Mak-1043/index.php)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 14, 2003, 9:13pm UTC](https://forum.kirupa.com/t/how-to-make-two-lines-snap-to-your-mouse-cursor/28531/3 "2003-08-14T21:13:43Z")

</div>

can you provide me the code for the lines only?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 14, 2003, 9:22pm UTC](https://forum.kirupa.com/t/how-to-make-two-lines-snap-to-your-mouse-cursor/28531/4 "2003-08-14T21:22:48Z")

</div>

this is the easiest way:  
make a movieclip with a big + in it, make sure the x and y lines meet at center of movieclip,  
then on that movieclip put:

onClipEvent (load) {  
startDrag(this, true);  
}

and set your movies framerate to like 20 so its not jerky

me waits for someone to post advanced actionscript version 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 14, 2003, 9:34pm UTC](https://forum.kirupa.com/t/how-to-make-two-lines-snap-to-your-mouse-cursor/28531/5 "2003-08-14T21:34:13Z")

</div>

how to set frame rate?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 14, 2003, 10:48pm UTC](https://forum.kirupa.com/t/how-to-make-two-lines-snap-to-your-mouse-cursor/28531/6 "2003-08-14T22:48:56Z")

</div>

when nothing is selected theres a box at the bottom titled properties, in the box frame rate: put 20

if its not there select somewhere in the movie not touching a object and rightclick and click on properties

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 15, 2003, 2:04am UTC](https://forum.kirupa.com/t/how-to-make-two-lines-snap-to-your-mouse-cursor/28531/7 "2003-08-15T02:04:39Z")

</div>

sorry, I tried what you have say but the big + doesn’t move. or it moves but the mouse centre is at the left side of the +

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 15, 2003, 2:14am UTC](https://forum.kirupa.com/t/how-to-make-two-lines-snap-to-your-mouse-cursor/28531/8 "2003-08-15T02:14:57Z")

</div>

Here’s teh zip file for what you wanted. Just edit the move clip to customize it but MAKE SURE IT IS COMPLETELY CENTERED!!! TO get this…

for the x - divide teh width of the cross by 2 and make it negative  
for the y - divide teh height of the cross by 2 and make it negative

And thats it!

Good luck!

:p: aussy
