# Placing object on rotated item at transformed coordinate

**URL:** https://forum.kirupa.com/t/placing-object-on-rotated-item-at-transformed-coordinate/198953
**Category:** flash
**Created:** [August 30, 2006, 12:29am UTC](https://forum.kirupa.com/t/placing-object-on-rotated-item-at-transformed-coordinate/198953 "2006-08-30T00:29:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Hofuzz](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@Hofuzz](https://forum.kirupa.com/u/Hofuzz)
#### Post date: [August 30, 2006, 12:29am UTC](https://forum.kirupa.com/t/placing-object-on-rotated-item-at-transformed-coordinate/198953/1 "2006-08-30T00:29:32Z")

</div>

I’m trying to drag and drop a MC on the stage onto a spinning circle, at which point the MC is duplicated and placed inside the circle (scope-wise) so that it spins with the circle.

But rather than ‘dropping’ at the spot where i released, since the circle is spinning, the MC (in this case a sqaure) gets placed where it would be if the circle’s rotation were at 0, not at the spot where i release. I thought globalToLocal would do the trick but i was wrong 😛

Is there some function for this or do I need to do some math to place the MC by calculating a formula with the \_rotation? (I’m allergic to trig… :p)

Right now my code looks like:

```auto

square_mc.onPress = function(){
    this.startDrag();
    oriX = this._x; //original spot of square
    oriY = this._y;
    
}
var counter = 0;
square_mc.onRelease = square_mc.onReleaseOutside = function(){
    this.stopDrag();
 if (disc_mc.hit_mc.hitTest(_root._xmouse,_root._ymouse,true)){
      newAttachment = disc_mc.attachMovie("square","test"+counter,counter);
        var posX = this._x - disc_mc._x;
        var posY = this._y - disc_mc._y;
        counter++;
    }
    this._x = oriX;
    this._y = oriY;   
                               
}

```

Your help much appreciated!  
–Hofuzz
