# Movement help

**URL:** <https://forum.kirupa.com/t/movement-help/17597>\
**Category:** Uncategorized\
**Created:** [April 7, 2003, 11:37am UTC](https://forum.kirupa.com/t/movement-help/17597 "2003-04-07T11:37:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![batmitra](https://avatars.discourse-cdn.com/v4/letter/b/85e7bf/32.png) [@batmitra](https://forum.kirupa.com/u/batmitra)\
**Post date:** [April 7, 2003, 11:37am UTC](https://forum.kirupa.com/t/movement-help/17597/1 "2003-04-07T11:37:13Z")

</div>

hi everyone

can someone help me whidth this please?

I saw this tutorial here at kirupa

[http://www.kirupa.com/developer/mx/ASmovement.htm](http://www.kirupa.com/developer/mx/ASmovement.htm)

then i tried to make something else,what i’m trying to do is:

-i have a movieclip that i called square  
-i have a button

what i want is to have that movie clip move slowly across the stage when and only when i click the button.My problem is that with the tutorial it works very nice because the code is on the onenterframe event of the object ,now how do i make this by cliking on a button since i can’t call onenter frame event of the object? Or can i?

thanks

---

<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:** [April 7, 2003, 11:48am UTC](https://forum.kirupa.com/t/movement-help/17597/2 "2003-04-07T11:48:02Z")

</div>

i guess you can use a variable…

```auto
// MovieClip
onClipEvent(enterFrame) {
speed = 1;
if (_parent.move) this._x += speed;
}
// Button
on (release) {
!move ? move=1 : move=0;
}

```

=)

---

<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:** [April 7, 2003, 12:02pm UTC](https://forum.kirupa.com/t/movement-help/17597/3 "2003-04-07T12:02:32Z")

</div>

thanks that’s it but instead of \_parent i used \_root

---

<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:** [April 7, 2003, 12:12pm UTC](https://forum.kirupa.com/t/movement-help/17597/4 "2003-04-07T12:12:03Z")

</div>

well, i didn’t use \_root because if you place both the MovieClip and the Button into another MovieClip, you wouldn’t need to change the script 😉
