Help with moving mc to set position and deleting enterframe?

Hi all,

I am having difficulty remembering how to move a movieclip to an x and y position by reducing or increasing it’s x and y until it has reached the location.

It is only working from one direction and not always deleting the onenterframe and sometimes stopping before it reaches the set position?

This is what i have so far!

    _root.Hull2.myFinalX = 590;
    _root.Hull2.myFinalY = 345;

    _root.Hull2.onEnterFrame=function(){

        if (mousePressed == false && _root.onTarget == false) {
        _root.Hull2._x = _root.Hull2._x 
        _root.Hull2._y = _root.Hull2._y 
            
        } else if (mousePressed == false && _root.onTarget == true) {
 
        if(_root.Hull2._x!=MynewX && _root.Hull2._y!=MynewY){
            
        MynewX = Math.round(this._x -= (this._x-this.myFinalX)/5);
        MynewY = Math.round(this._y -= (this._y-this.myFinalY)/5);
         trace("MynewX="+MynewX)
        trace("MynewY="+MynewY)
        }else{
        
        delete this.onEnterFrame;
        trace("deleted")
        
        }
}