Strange rotation problem

Hi, i am really hoping someone can point me in the right direction with this.

First a little background info

i am drawing a rectangle with round corners using the drawing api. the width and height is equal to a percentage of the stage width and height

once i have completed that, i set the position of the rectangle to be aligned to the center of the stage.

once that is completed, i call a function that makes the rectangle rotate backwards and forwards using rotationX

the problem is that for some reason the right hand side extends a lot more than the left hand side, making the rectangle look distorted.

Attached is an example of the problem im experiencing. The red lines shows the outline of the rectangle, the blue lines shows the maximum
rotation position on the left hand side, and as you can see, the right hand side extends way further than the left.

The odd thing is that it works fine if i preview the swf alone, but it gets all messed once i preview it in the html.

Can anyone please explain to me what im doing wrong?

It really would be greatly appreciated

Thanks in advanced