# Navigating around points on a map

**URL:** https://forum.kirupa.com/t/navigating-around-points-on-a-map/274815
**Category:** flash
**Created:** [November 5, 2008, 10:27am UTC](https://forum.kirupa.com/t/navigating-around-points-on-a-map/274815 "2008-11-05T10:27:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![onion](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/onion/32/3349_2.png) [@onion](https://forum.kirupa.com/u/onion)
#### Post date: [November 5, 2008, 10:27am UTC](https://forum.kirupa.com/t/navigating-around-points-on-a-map/274815/1 "2008-11-05T10:27:34Z")

</div>

Hello! I have a large map image that I want to navigate around. There are certain points on the map that I want to go to when links are pressed. What i’m doing is just moving the map around so that you can only see certain bits of it.

I have worked out the code to make it go to certain points, but the animation is not smooth. It currently just moves to the coordinates and then stops. I want to ease it into position.

Can anyone help? I have pasted my working code below.

Thanks!! 🙂

```auto
 
moveMap = function(xCoord,yCoord){
  
  //--work out the distance
  dX=xCoord-Math.abs(map._x);
  dY=yCoord-Math.abs(map._y);
  
  if(xCoord>(550/2))
   dX-=(550/2);
   
  if(yCoord>(400/2))
   dY-=(400/2);     
  
  //--how many frames it will take
  steps=60;
  
  //--work out the speed
  sX=dX/steps;
  sY=dY/steps;
  
  stepCount=0;
 
 map.onEnterFrame = function(){
      
  if(stepCount<steps)
  {
   this._x-=sX;
   this._y-=sY;
  }
  else
  {
   delete(this.onEnterFrame);
  }
  
  stepCount++;  
 }
}

```
