# Help needed on paning map

**URL:** <https://forum.kirupa.com/t/help-needed-on-paning-map/194080>\
**Category:** Uncategorized\
**Created:** [July 20, 2006, 11:22am UTC](https://forum.kirupa.com/t/help-needed-on-paning-map/194080 "2006-07-20T11:22:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavanshinde](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@pavanshinde](https://forum.kirupa.com/u/pavanshinde)\
**Post date:** [July 20, 2006, 11:22am UTC](https://forum.kirupa.com/t/help-needed-on-paning-map/194080/1 "2006-07-20T11:22:19Z")

</div>

Hi All

I wana have an automated paning in flash. i have a map i want when user double clicks some where on the map then map then should start paning and stop when center the map on the spot that the user doubled clicked.

Here is the code for double click

//set initial variables  
click = false;  
//function for the button press  
button\_btn.onPress = function() {  
//if this is the first click  
if (!click) {  
timer = getTimer()/1000;  
\_root.click = true;  
//find out if it is a double click  
} else {  
timer2 = getTimer()/1000;  
\_root.test2 = timer2-timer;  
//if it is a double click  
if ((timer2-timer)\<.25) {  
//toggle the box mc on and off

// Some code goes here

trace(“Double click detected”)

```
    //if it is not a double click, reset the variables to a single click
    } else {
        timer = getTimer()/1000;
        _root.click = true;
    }
}

```

};

Thanks
