# Question Regarding startdrag() bounds

**URL:** <https://forum.kirupa.com/t/question-regarding-startdrag-bounds/316230>\
**Category:** flash\
**Created:** [November 16, 2010, 12:59pm UTC](https://forum.kirupa.com/t/question-regarding-startdrag-bounds/316230 "2010-11-16T12:59:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leeda111](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@leeda111](https://forum.kirupa.com/u/leeda111)\
**Post date:** [November 16, 2010, 12:59pm UTC](https://forum.kirupa.com/t/question-regarding-startdrag-bounds/316230/1 "2010-11-16T12:59:42Z")

</div>

Hi,

I am trying to make this an kinda interactive map in flash. I will try to explain it for better explanation. Here is an image of the output

![](http://img405.imageshack.us/img405/3852/110101674436testcitiesb.png)

I have a jpg image(converted to movieclip) which is way larger than the stage.

Stage: 550\*400

Image height:835  
Image Width:1500

Then I have a mask in the center of the stage and user sees a portion of the map and is allowed to scroll to move mouse around to see areas around the focused city.

Here is the code:

```auto

stop();

myImage1.mask=myMask1;

myImage1.addEventListener(MouseEvent.MOUSE_DOWN, startdrag);
myImage1.addEventListener(MouseEvent.MOUSE_UP, stopdrag);

function startdrag(event:MouseEvent):void{

var bounds:Rectangle = new Rectangle(-343,-145,1257,649);
myImage1.startDrag(false,bounds);

}

function stopdrag(event:MouseEvent):void{
myImage1.stopDrag();
}

```

\*\*\*My question is what are the numbers in  
**var bounds:Rectangle = new Rectangle(-343,-145,1257,649);**

I put this numbers in by playing around but where are these values exactly coming from. I have tried everything(every possible way) but cant figure out what are these values. I need to numbers to be dynamic so I can change the focus to different cities(for example when a user click A city A should be seen inside the mask and so on).  
How can I make these values dynamic instead of hard coding them.

* * *

I hope I tried to make this as clear as possible. I myself is confused. So if needed I will upload the code.

Thanks in advance.

Best Regards,  
Adeel Abbas
