You can adapt a class example for timeline by removing the package line, removing the class line, removing the "constructor" opening, and deleting any "private" or "public" words. Also delete any extra closed braces at the end of the script, and the end of where the constructor function was.
In this example's case there is one line that you have to add something, which is where the stage reference is stored. Or you could replace that variable with "stage". In my version below I just put stage into that variable.
So, make a new movieclip on your FLA stage, go into the movieclip, and put this script into frame 1's timeline, then do a test movie:
import flash.display.MovieClip;
import flash.events.*;
import flash.display.Stage;
var stageRef:Stage = stage;
var speed:Number = 10;
x = stageRef.stageWidth / 2;
y = stageRef.stageHeight / 2;
this.stageRef = stageRef;
addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
function loop(e:Event):void {
var yDistance:Number = stageRef.mouseY - y;
var xDistance:Number = stageRef.mouseX - x;
if (Math.sqrt(yDistanceyDistance + xDistancexDistance) < speed) {
x = stageRef.mouseX;
y = stageRef.mouseY;
} else {
var radian:Number = Math.atan2(yDistance,xDistance);
x += Math.cos(radian) * speed;
y += Math.sin(radian) * speed;
rotation = radian * 180 / Math.PI;
}