# Flash mx beginner... movieclip manipulation question

**URL:** https://forum.kirupa.com/t/flash-mx-beginner-movieclip-manipulation-question/33806
**Category:** Uncategorized
**Created:** [October 23, 2003, 7:36pm UTC](https://forum.kirupa.com/t/flash-mx-beginner-movieclip-manipulation-question/33806 "2003-10-23T19:36:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![xZeRox](https://avatars.discourse-cdn.com/v4/letter/x/8797f3/32.png) [@xZeRox](https://forum.kirupa.com/u/xZeRox)
#### Post date: [October 23, 2003, 7:36pm UTC](https://forum.kirupa.com/t/flash-mx-beginner-movieclip-manipulation-question/33806/1 "2003-10-23T19:36:57Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 23, 2003, 8:15pm UTC](https://forum.kirupa.com/t/flash-mx-beginner-movieclip-manipulation-question/33806/2 "2003-10-23T20:15:11Z")

</div>

Welcome, xZeRox. :beam:

You could use the [[font=courier new]MovieClip.hitTest()[/font]](http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary534.html) method:

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

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 23, 2003, 8:19pm UTC](https://forum.kirupa.com/t/flash-mx-beginner-movieclip-manipulation-question/33806/3 "2003-10-23T20:19:12Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 23, 2003, 8:44pm UTC](https://forum.kirupa.com/t/flash-mx-beginner-movieclip-manipulation-question/33806/4 "2003-10-23T20:44:33Z")

</div>

awesome! thnx Kode! it works brilliantly.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 23, 2003, 8:47pm UTC](https://forum.kirupa.com/t/flash-mx-beginner-movieclip-manipulation-question/33806/5 "2003-10-23T20:47:17Z")

</div>

No problem, xZeRox. 😉

And glad you figured it out, Yeldarb. 😛
