Flash mx beginner... movieclip manipulation question

hi everybody, this is my first post here, so plz be gentle. im a beginner at using flash mx actionscript with no previous programming experience.

im currently doing an animation where a movie clip moves from right to left using this code i found at the tutorials section:

onClipEvent(enterFrame) {
speed = 2;
this._x += speed;
}

now what i want to do is have the move clip stop moving when the user puts the mouse over it, but i dont know how to do that, plz help. :slight_smile:

xZeRox

Welcome, xZeRox. :beam:

You could use the [font=courier new]MovieClip.hitTest()[/font] method:

onClipEvent (load) {
var speed = 2;
}
onClipEvent (enterFrame) {
this._x += !this.hitTest(this._parent._xmouse, this._parent._ymouse, true)*speed;
}

how does that work kode?
where is the if/then statement?
i dont get it… :frowning:

EDIT: Oh, I see, if it is on it it will be 0 and 0 times 2 is 0, cool code kode

awesome! thnx Kode! it works brilliantly.

No problem, xZeRox. :wink:

And glad you figured it out, Yeldarb. :stuck_out_tongue: