type = 'application/x-shockwave-flash'
data = 'http://sitepointstatic.com/flash/cursor.swf'
width = '400'
height = '400'
bgcolor = 'black'
>

Download the sample files here.

1. Create a movieclip from any object. I used a circle.

1065_tool1

2. Give the movieclip instance a name. Here I’ve used "circle1".

3. Create 3 keyframes as shown below:

1065_tool2

4. In the first key frame, use the action:

startDrag ("str1", true); 

5. In the second key frame apply the action:

count = count + 1; 
if (count > 10)  
{ count = 1 }  
duplicateMovieClip ( "str1","str"&count, count );

6. In the third key frame, insert the action:

gotoAndPlay (2); 

7. Bravo! You’ve made your own cool cursor tracking effect!

Georgina has more than fifteen years' experience writing and editing for web, print and voice. With a background in marketing and a passion for words, the time Georgina spent with companies like Sausage Software and sitepoint.com cemented her lasting interest in the media, persuasion, and communications culture.

Get your free chapter of Level Up Your Web Apps with Go

Get a free chapter of Level Up Your Web Apps with Go, plus updates and exclusive offers from SitePoint.


No Reader comments

Related books & courses
Available now on SitePoint Premium

Preview for $1