# FMX StartDrag not snapping to centre

**URL:** <https://forum.kirupa.com/t/fmx-startdrag-not-snapping-to-centre/26010>\
**Category:** flash\
**Created:** [July 18, 2003, 3:00pm UTC](https://forum.kirupa.com/t/fmx-startdrag-not-snapping-to-centre/26010 "2003-07-18T15:00:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![davymacca](https://avatars.discourse-cdn.com/v4/letter/d/5f8ce5/32.png) [@davymacca](https://forum.kirupa.com/u/davymacca)\
**Post date:** [July 18, 2003, 3:00pm UTC](https://forum.kirupa.com/t/fmx-startdrag-not-snapping-to-centre/26010/1 "2003-07-18T15:00:35Z")

</div>

Is there a way to have the startDrag command not lock to the centre of a MC but to have it snap and drag from a set location, ie \_x and \_y positions, on a MC.

If anyone can help it will be MUCH appreciated =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 18, 2003, 4:04pm UTC](https://forum.kirupa.com/t/fmx-startdrag-not-snapping-to-centre/26010/2 "2003-07-18T16:04:42Z")

</div>

When you set the snap to mouse to true in the startDrag, it snaps the clips registration point to the mouse.

So with that said, you can

A) Create the clip and set the registration point in the new area… here is an image from a [kirupa.com](http://kirupa.com) tutorial to help explain…  
[http://www.kirupa.com/developer/mx/images/loadBar.gif](http://www.kirupa.com/developer/mx/images/loadBar.gif)

Or

B) Open up your current clip and reposition the content so that the point you want the mouse to be snapped to is at the coords (0,0)

I hope I helped 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 21, 2003, 12:27pm UTC](https://forum.kirupa.com/t/fmx-startdrag-not-snapping-to-centre/26010/3 "2003-07-21T12:27:13Z")

</div>

thank you for that, but I don’t think I explained myself well enough.

Hear is the problem:

I am creating a kind of Jigsaw game but with shapes, eg triangle, diamond, square.

The centre point of the movie clip is at edge of the shape, as described above. This point is the reference for rotation and the snap-To-Grid position and cannot be changed.

What I want is when a shape is selected (ie. StartDrag(true) is called) it moves the shape from a different point, not the edge that has already been specified.

Something like :  
\_xmouse+15  
\_ymouse+20

to be added to the shape so it drags from the centre of the shape but rotates around a point which is in a different place.

I don’t know if this is any clearer but thanks anyway

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 21, 2003, 12:35pm UTC](https://forum.kirupa.com/t/fmx-startdrag-not-snapping-to-centre/26010/4 "2003-07-21T12:35:57Z")

</div>

> 

Something like :  
\_xmouse+15  
\_ymouse+20

doesnt that work well ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 21, 2003, 12:39pm UTC](https://forum.kirupa.com/t/fmx-startdrag-not-snapping-to-centre/26010/5 "2003-07-21T12:39:25Z")

</div>

it may well do but as I am only a begginer I am not sure were I need to add it, can it just be added to the startDrag() command instead of “true” or something to that effect

???

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 21, 2003, 12:46pm UTC](https://forum.kirupa.com/t/fmx-startdrag-not-snapping-to-centre/26010/6 "2003-07-21T12:46:19Z")

</div>

This is the file that I am using at the moment

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 21, 2003, 1:20pm UTC](https://forum.kirupa.com/t/fmx-startdrag-not-snapping-to-centre/26010/7 "2003-07-21T13:20:59Z")

</div>

instead of using startDrag, use  
onClipEvent(load){  
offsetx=100  
offsety=60  
}  
onClipEvent(enterFrame){  
\_x=\_root.\_xmouse-offsetx  
\_y=\_root.\_ymouse-offsety  
}

i still don’t really understand what u want

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 21, 2003, 1:25pm UTC](https://forum.kirupa.com/t/fmx-startdrag-not-snapping-to-centre/26010/8 "2003-07-21T13:25:13Z")

</div>

ThankYou that is exactally what I want

You guys are great :beam:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 21, 2003, 1:46pm UTC](https://forum.kirupa.com/t/fmx-startdrag-not-snapping-to-centre/26010/9 "2003-07-21T13:46:03Z")

</div>

glad i could help =)
