xZeRox
1
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. 
xZeRox
system
2
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;
}
system
3
how does that work kode?
where is the if/then statement?
i dont get it⦠
EDIT: Oh, I see, if it is on it it will be 0 and 0 times 2 is 0, cool code kode
system
4
awesome! thnx Kode! it works brilliantly.
system
5
No problem, xZeRox. 
And glad you figured it out, Yeldarb. 