# Drag MC limited to circular area and other MC

**URL:** https://forum.kirupa.com/t/drag-mc-limited-to-circular-area-and-other-mc/328575
**Category:** flash
**Created:** [May 28, 2012, 1:40am UTC](https://forum.kirupa.com/t/drag-mc-limited-to-circular-area-and-other-mc/328575 "2012-05-28T01:40:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Antonio\_Pereira](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Antonio\_Pereira](https://forum.kirupa.com/u/Antonio_Pereira)
#### Post date: [May 28, 2012, 1:40am UTC](https://forum.kirupa.com/t/drag-mc-limited-to-circular-area-and-other-mc/328575/1 "2012-05-28T01:40:31Z")

</div>

Hi guys.

Hi need a little help here. I’m creating a game where I have one MC for the map (mcMap), other MC for the player mark (mcPlayer).

There are 4 Players, and all of them are Childs of the mcMap.

The players can move in a limited distance in any direction (circular area), and cannot go outside the map. I want a circle to appear (with alpha) showing the draggable area to the player.

I already tried the following code, but it only works for rectangular area, and is not limited to the map.

```auto

var rectangle:Rectangle = new Rectangle(markPlayer1.x, markPlayer1.y, 200, 150); 
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseStartDrag);
 
function mouseStartDrag(motion:MouseEvent):void {
markPlayer1.startDrag(false, rectangle);
}

stage.addEventListener(MouseEvent.MOUSE_UP, mouseStopDrag);
 
function mouseStopDrag(motion:MouseEvent):void {
markPlayer1.stopDrag();
}

```

Can anyone help me?
