# localToGlobal & globalToLocal - what about ROTATION?

**URL:** <https://forum.kirupa.com/t/localtoglobal-globaltolocal-what-about-rotation/205728>\
**Category:** flash\
**Created:** [November 1, 2006, 12:22pm UTC](https://forum.kirupa.com/t/localtoglobal-globaltolocal-what-about-rotation/205728 "2006-11-01T12:22:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![masster](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/masster/32/627_2.png) [@masster](https://forum.kirupa.com/u/masster)\
**Post date:** [November 1, 2006, 12:22pm UTC](https://forum.kirupa.com/t/localtoglobal-globaltolocal-what-about-rotation/205728/1 "2006-11-01T12:22:42Z")

</div>

Hi,  
localToGlobal & globalToLocal are pretty cool methods for movie clips.

Except one thing. Rotations go bad. Let me explain it to you:

Say you have a **movie\_B** inside a movie\_A, loaded externally. And say you need to make a duplicate of movie B on stage at new coordinates **(newx,newy)** and rotated around its center by **rot** degrees. And we do the code:

> 

//load external movie\_A  
var newClip:MovieClip = this.createEmptyMovieClip(holderName, this.getNextHighestDepth());  
var jClip:MovieClip = newClip.createEmptyMovieClip(“jClip”, newClip.getNextHighestDepth());  
jClip.loadMovie(“path\_to\_swf\_movie”);  
jclip.\_x = 0;  
jClip.\_y = 0;  
newClip.\_x = xPos;  
newClip.\_y = yPos;  
//convert global target point to local coordinates  
var point:Object = {x:newx, y:newy};  
obj.globalToLocal(point);  
//duplicate movie  
movieB.duplicateMovieClip(“newName”, depth, {\_x:point.x,\_y:point.y,\_rotation:rot});

Is this OK? NO, it’s not, because duplicate movie will rotate NOT around its center, but around original movie center. Which sucks.

HOW can this be fixed, please?

Thanks
