# rotationX/Y problem on stageResize - please read

**URL:** <https://forum.kirupa.com/t/rotationx-y-problem-on-stageresize-please-read/289056>\
**Category:** flash\
**Created:** [May 25, 2009, 8:46pm UTC](https://forum.kirupa.com/t/rotationx-y-problem-on-stageresize-please-read/289056 "2009-05-25T20:46:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![humbucker](https://avatars.discourse-cdn.com/v4/letter/h/278dde/32.png) [@humbucker](https://forum.kirupa.com/u/humbucker)\
**Post date:** [May 25, 2009, 8:46pm UTC](https://forum.kirupa.com/t/rotationx-y-problem-on-stageresize-please-read/289056/1 "2009-05-25T20:46:51Z")

</div>

[LEFT]Hi there,

I’m playing around with CS4, AS3 and rotationX and rotationY on a reg-point centered MC base on the mouseX & Y position.

At initial stage size, everything reacts well, rotates and so on,  
but when I resize my screen, my MC seems to centers badly on stage (I got a listener and a function to set x and y pos of my MC on stageResize)  
and the rotation badly respons to the mouse position.

Here is the code I’m using for the enterFrame rotation

```auto

var distx:Number = mouseX / stage.stageWidth; 
var disty:Number = mouseY / stage.stageHeight; /
Tweener.addTween(regPoint, {rotationY:(-70 + (140*distx)), rotationX:(70 - (140*disty)), time:1, transition:"easeOut"}); 

```

Any idea how I could fix this ?

Thanks a lot !  
[/LEFT]
