Stop it moving

[font=Courier New][size=2][color=#000080]onClipEvent[/color][/size][/font][font=Courier New][size=2][color=black]([/color][/size][/font][font=Courier New][size=2][color=#000080]enterFrame[/color][/size][/font][font=Courier New][size=2][color=black]) {
speed = 1;
[/color][/size][/font][font=Courier New][size=2][color=#000080]this._x[/color][/size][/font][font=Courier New][size=2][color=black] += speed;

[font=Courier New]this code makes the object move, how to make it stop at a specific position?[/font]

onClipEvent (enterFrame) {
     var speed = 1;
     if (speed == 10) {
          delete this.onEnterFrame;
     } else {
          this._x  += speed;

But there are actually many different ways of doing this. You could even use the hidden tween function to move it to a certain point and have it stop. It’ll look smoother, and you can easily add some nice elasticity effects. :wink: