This is great for beginners but it has many limitations. For starters it will keep moving left or right, past where my mouse sits. Also it will stop when it reaches the bounds of the animation. It's also a bit buggy. Like I say, just an example, let's move on to the real thing.

Grab the source here. Once again this is just a sample, so you don't really need to download this one, but you need t o read how it works below.
This version is completely Actionscript based and more practical. Instead of an animated clip on the stage I have just one movie clip with 1 frame and an instance name of 'circle'. Once again I have the controller clip with two frames, although the code is slightly different this time.

if (_root._xmouse>=200) {
 _level0.circle._x = (_level0.circle._x+10);
} else {
 _level0.circle._x = (_level0.circle._x-10);
}

We're still using the same conditional statement which checks if the mouse position on the X axis is greater than half the width of the movie, (is the mouse in the right hand side of the movie in other-words), however now we're using setProperty to tween the circle along the X axis. Rather than moving an animation of a tween forward or backwards frame by frame, we take the current X position ( _level0.circle._x ) and add or subtract 10 pixels to it. Frame 2 has the same code, but with a gotoAndPlay (1); as before, to loop back to frame 1.

This one is nicer but it still has problems. For instance, observe that the circle can move outside the bounds of the movie clip, and as before, if you stop moving your mouse it keeps moving past your mouse because your mouse is still on the right or left side of the movie. We'll fix that in the next example.

Now it's time to bring out the big guns. I'm sick of my circle deliberately misconstruing my commands. I say 'come here' and it comes, but then it keeps moving! It's time to teach that circle some manners. No circle should walk before it's Master Mouse!

You really should download the source for this one.
At last! A well mannered circle animation! Now I can sleep at night.

Seriously though, doesn't it look better when the circle stops moving next to the mouse? Wouldn't you like to make that happen to? You can, and it's easy peasy. The structure for this example is exactly as before, with a movie clip with one frame and an instance name, on the main scene in frame 1. Our controller clip is there too, only it's commands are slightly different now:

Controller clip - Frame 1:

if (_root._xmouse>_level0.circle._x) {
 _level0.circle._x = (_level0.circle._x+10);
} else {
 _level0.circle._x = (_level0.circle._x-10);
}

(As always, Frame 2 has the gotoAndPlay for looping purposes.)

Now, the setPeoperty bit here, where we add 10 pixels to the current X position is just the same as the previous example. What we have changed is the conditional clause. Before we were moving the circle depending on which hemisphere of the movie the mouse was in (left or right side). Now we've changed our tune and we only want to move the circle if it's X position is different to that of the mouse. This is shown by: if (_root._xmouse > _level0.circle._x) which translates loosely in English into: "If the _x position of the mouse is greater than the X position of the circle, then do the following action". The action which follows is of course to move the circle until the X positions are no longer different.