# Movement using ActionScript \[Mx2004\]

**URL:** <https://forum.kirupa.com/t/movement-using-actionscript-mx2004/207889>\
**Category:** flash\
**Created:** [November 22, 2006, 2:12pm UTC](https://forum.kirupa.com/t/movement-using-actionscript-mx2004/207889 "2006-11-22T14:12:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juduth](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/juduth/32/2335_2.png) [@Juduth](https://forum.kirupa.com/u/Juduth)\
**Post date:** [November 22, 2006, 2:12pm UTC](https://forum.kirupa.com/t/movement-using-actionscript-mx2004/207889/1 "2006-11-22T14:12:14Z")

</div>

Hello,

I need help with movement using ActionScript as I can’t find a how-to that fits my needs all over the web 😕  
It all starts with a Clip that I move to the center of the Stage when website starts. This is the code inside it:

```auto
onClipEvent (enterFrame) {
    Velocidad = 5;
    Yfinal = Math.round((Stage.height/2)-(this.fondo._height/2));
    Xfinal = Math.round((Stage.width/2)-(this.fondo._width/2));
    this._y += (Yfinal-this._y)/Velocidad;
    this._x += (Xfinal-this._x)/Velocidad;
}

```

This code works fine for what I need ( it also corrects position when I resize Stage without using Listeners), but I would like to **come back to its original position** when I change seccion on the website.

I know that if I put this code inside the **enterframe** it will never let me change to another position:

```auto
Yfinal = Math.round((Stage.height/2)-(this.fondo._height/2));
    Xfinal = Math.round((Stage.width/2)-(this.fondo._width/2));

```

…so I will like to know a pair of things:

1. How to disable that concrete onClipEvent
2. Another better way to animate my Clips & having possibility to get them backwards
3. Any usefull links would be nice also 😉

Thanks everyone posting here!
