# Positioning after stage resize

**URL:** <https://forum.kirupa.com/t/positioning-after-stage-resize/324527>\
**Category:** flash\
**Created:** [August 25, 2011, 1:11pm UTC](https://forum.kirupa.com/t/positioning-after-stage-resize/324527 "2011-08-25T13:11:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yerbaps](https://avatars.discourse-cdn.com/v4/letter/y/9f8e36/32.png) [@yerbaps](https://forum.kirupa.com/u/yerbaps)\
**Post date:** [August 25, 2011, 1:11pm UTC](https://forum.kirupa.com/t/positioning-after-stage-resize/324527/1 "2011-08-25T13:11:00Z")

</div>

Hi there,

I’m a little confused with 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.

```auto

var ellipse:Shape = new Shape();
ellipse.graphics.beginFill(0x6CCDF4, 0.5);
ellipse.graphics.lineStyle(4,0x186B87);
ellipse.graphics.drawEllipse(0, 0, 100, 100);
ellipse.graphics.endFill();
join.canvas.addChild(ellipse);

```

If I check the coordinates of that ellipse from it’s transform property, I see that the top left is at 400, 300.

```auto
ellipse.transform.pixelBounds.topLeft.x
ellipse.transform.pixelBounds.topLeft.y

```

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.

```auto
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.

Is there a better way of finding the position of the ellipse to avoid this? Or is there a way for me to calculate this change?

Thanks,

Baps.
