Aug 25, 2011
coordinates in flash, particularly after resizing the flash player window.I have an mc on stage and draw an ellipse inside that mc. The movie is of size 800 x 600.
View 12 Replies
var ellipse:Shape = new Shape();
If I check the coordinates of that ellipse from it's transform property, I see that the top left is at 400, 300.
This seems fine to me as this position is in relation to the stage, yes? If I convert this to a position local to the container I get values ~0,0.
var stagePoint:Point = new Point(ellipse.transform.pixelBounds.topLeft.x, ellipse.transform.pixelBounds.topLeft.y);
var localPoint:Point = join.canvas.globalToLocal(stagePoint);
When the flash player window is resized, the coordinates change entirely. Instead of being at 400,300 the transform property indicates that it is at 640, 510. I assume this is because the viewport has changed, but the stageWidth and width properties of the stage do not change.