Any visual object on stage are represented by x and y coordinates. This tutorial will show you how to create some object which will follow a mouse moving, using action script.
Step 1Create a new flash document, draw some object or import any picture (Ctrl+R - Import to Stage), select it and press F8 on the keyboard (Convert to Symbol) to convert it into a Movie Clip.

Step 2While your object is still selected, open the Action Script Panel (F9), and paste this script:
onClipEvent (enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
}
Test your movie (Ctrl+Enter)
We're done!
Bye!
Download source file (.fla)