Interact with moving object problem

I have used AS to make flying ‘pods’ move from the left to right side of the screen.

how can I make them stop when a user rolls over them and make then make them act like conventional buttons to jump to different parts of the movie?

if you tweened the animation:


onClipEvent (enterFrame) {
	if (this.hitTest(_root._xmouse, _root._ymouse)) {
		this.stop();
		}
}

(I had a movie which contained another movie: the circle, I put the action on the first movie, look at the fla if needed)

Now if you need to put buttons on it all you have to do is add them in the circle MC

> Forgot to post that if you made them move using AS post your code; somehow it would be the same as


onClipEvent (enterFrame) {
        if (this.hitTest(_root._xmouse, _root._ymouse)) {
                this.stop();
        }
}

except that this.stop() would be changed if something else (ie setting the speed of your moving pods to 0 or something alike)

Thanks for the help! I followed ‘movement with actionscript’ tute here on Kirupa which used the following code:

onClipEvent (enterFrame) {
//generating movement
location = this._x;
var i;
i = 1+_root._xmouse/30;
if (this, hitTest(_root.block)) {
this._x = -1000
;
} else {
this._x = location+i++;
}
}

this also makes the pods move back to the lefthand side when they have gone off-screen on the right.

How could I make the object continue moving if you rollout from it - in your sample the button would stay where it is.

All this actionscript stuff is pretty amazing stuff - I’m just starting to play - lots to take in!