# Not Centering Correctly!

**URL:** <https://forum.kirupa.com/t/not-centering-correctly/287836>\
**Category:** flash\
**Created:** [May 6, 2009, 9:12pm UTC](https://forum.kirupa.com/t/not-centering-correctly/287836 "2009-05-06T21:12:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![split67](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/split67/32/2089_2.png) [@split67](https://forum.kirupa.com/u/split67)\
**Post date:** [May 6, 2009, 9:12pm UTC](https://forum.kirupa.com/t/not-centering-correctly/287836/1 "2009-05-06T21:12:50Z")

</div>

I’ve attached a screen capture of what is going on. Why is the below code not working properly? I’ve looked everywhere and everything is the same for centering a video on the stage. For some reason, it’s moving the top left corner of all videos to the center of the stage. I’m using XML to load a playlist of external videos. Some are 16x9 ratio & some are 3x2 ratio. This is why i’m wanting to center the loaded video on stage. Thanks for any help!!

```auto

vid.x = (stage.stageWidth - vid.width) / 2;
vid.y = (stage.stageHeight - vid.height) / 2;

```
