Flash Script – Cursor Trick 1: Cross Hair Cursor

By Georgina Laidlaw

Want to make a cross hair cursor in Flash? Look no further!
Download the sample files here.

1. First, create a line with a length that’s equal to the length of the stage.

2. Convert the line to a movie clip, and give it an instance name of "yline".

3. Drag an instance of the line movie clip from the library, and give this an instance name "xline".

4. Create a small circle, and convert this to a movie clip.

5. Right click the circle movie clip, go to actions, and insert:

onClipEvent (enterFrame)  
startDrag ("", true);
setProperty ("/yline", _y, _y);
setProperty ("/xline", _x, _x);

That’s it, run the movie! You have created a simple cross hair cursor.

No Reader comments



Because We Like You
Free Ebooks!

Grab SitePoint's top 10 web dev and design ebooks, completely free!

Instant Website Review

Use Woorank to analyze and optimize your website to improve your website to improve your ranking!

Run a review to see how your site can improve across 70+ metrics!

Get the latest in Front-end, once a week, for free.