Movement help

hi everyone

can someone help me whidth this please?

I saw this tutorial here at kirupa

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?


i guess you can use a variable…

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


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

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 :wink: