Tutorial details:
Written by: Flashjunki
Difficulty Level: Advanced
Requirements: Flash 4
Download FLA

Notes: There is a flaw in the programming - the four cardinal compass points (0, 90, 180, 270) don't work! Every other angle works and since for my purposes this is going to work just fine I am stopping spending time on this. If you can figure out what part of my programming is flawed I'd be glad to hear from you!

Trig Refresher
//Comment: ----------------------------------------------
//Comment: Manually Set Movie Center
//Comment: ----------------------------------------------
//Comment: also set the origin of the line object movie clip to this number
 Set Variable: "scr_ctr_x" = 200
 Set Variable: "scr_ctr_y" = 200
//Comment: ----------------------------------------------
//Comment: lookup table for sine values
//Comment: ----------------------------------------------
 Set Variable: "sine_lookup_table" = "0.000/.0175/.0349/.0523/.0698/.0872/

Above is the "variable" frame on the main timeline. In it, we need to set the 0,0 point of the effect. The reason is, Flash's 0,0 point is at the top left hand corner of the movieboard. Since my movie is 400x400 the point 200,200 is a convenient point to centre the effect on. The 0,0 point of the "pointer line" is also at 200,200. Notice the way that movie clip is built. You will see that the little "plus" sign (the origin) is at the point of the artwork around which the rotation will occur. We will use these variables later.

The other important thing you need is a sine lookup table. Why? You need to do some trig! Since Sin(Theta)=O/Hyp and since this relationship is always constant (in other words, it doesn't matter what length 'O' and 'Hyp' are, their proportions will always be the same when the angle between them is the same.) Hey. I may not be the best at explaining this stuff.

So once you understand how to find an angle from two measurements, then look what to do--- break it down into programming components:
//Comment: ----------------------------------------------
//Comment: get mouse location
//Comment: ----------------------------------------------
 Set Variable: "mouse_x" = GetProperty("",_x) - ..:scr_ctr_x
 Set Variable: "mouse_y" = GetProperty("",_y) - ..:scr_ctr_y

There is a movie clip on the main timeline in the "Controller" layer. It serves three purposes... it holds all the actionscript that makes this work, it is dragged so we can determine the mouse x,y coordinate, and it holds the objects which follow the mouse telling you useful information.