# Referencing stage.width/height references mc.width/height?

**URL:** <https://forum.kirupa.com/t/referencing-stage-width-height-references-mc-width-height/312302>\
**Category:** flash\
**Created:** [July 30, 2010, 2:59am UTC](https://forum.kirupa.com/t/referencing-stage-width-height-references-mc-width-height/312302 "2010-07-30T02:59:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![timmy666](https://avatars.discourse-cdn.com/v4/letter/t/a4c791/32.png) [@timmy666](https://forum.kirupa.com/u/timmy666)\
**Post date:** [July 30, 2010, 2:59am UTC](https://forum.kirupa.com/t/referencing-stage-width-height-references-mc-width-height/312302/1 "2010-07-30T02:59:09Z")

</div>

Hey guys,

I am trying to reference to top level (stage) width and height of the main stage for the placement of something located inside a movieclip on the stage.

My code is:

```auto
    my_loader.x = (stage.stageWidth - my_loader.width)/2;
    my_loader.y = (stage.stageHeight - my_loader.height)/2;

```

But this seems to just relate to the width/height of the mc that my\_loader is nested in…

I have tried the following and had no luck:  
stage.stage.stageWidth  
root.stage.stageWidth  
parent.stage.stageWidth  
MovieClip(root).stage.stageWidth

What is the correct code? or am i doing something else wrong?
