# FullScreen flash... problem with movieClip positioning

**URL:** https://forum.kirupa.com/t/fullscreen-flash-problem-with-movieclip-positioning/263879
**Category:** flash
**Created:** [June 20, 2008, 12:19am UTC](https://forum.kirupa.com/t/fullscreen-flash-problem-with-movieclip-positioning/263879 "2008-06-20T00:19:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![designFanatic](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@designFanatic](https://forum.kirupa.com/u/designFanatic)
#### Post date: [June 20, 2008, 12:19am UTC](https://forum.kirupa.com/t/fullscreen-flash-problem-with-movieclip-positioning/263879/1 "2008-06-20T00:19:22Z")

</div>

Hey,

I’m currently programming a site available to see at:

[http://biddleinc.ca/empiregrill/](http://biddleinc.ca/empiregrill/)

The problem i have is that when I load in external .swf files which are bigger than the main centered movieClip (centeredContent\_mc)… if you resize the browser it will bump the center section to a new position because it’s size has changed. You can see this in the “Take a tour” section.

This is the code im using:

[COLOR=Blue]Stage.scaleMode = “noScale”;  
Stage.align = “TL”;

var stageListener: Object = new Object();

stageListener.onResize = positionContent;

Stage.addListener(stageListener);

function positionContent():Void  
{  
centeredContent\_mc.\_x = Stage.width/2 - centeredContent\_mc.\_width/2;  
centeredContent\_mc.\_y = Stage.height/2 - centeredContent\_mc.\_height/2;

```
if ( Stage.height/Stage.width &gt; background_mc._height / background_mc._width )
{
    var ratio = background_mc._width/background_mc._height;
    
    if ( Stage.height &gt; 400 )
    {
        background_mc._height = Stage.height;
        background_mc._width = Stage.height*ratio;
    }
}
else
{
    var ratio = background_mc._height/background_mc._width;

    if ( Stage.width &gt; 400 )
    {
        background_mc._width = Stage.width;
        background_mc._height = Stage.width*ratio;
    }
}    

```

}

positionContent();[/COLOR]  
My question is: Is there any way to specify the new movieClip and keep if from changing the size of the mc it’s being loaded into?

I would GREATLY appreciate any replies!!! PS-AS2

---

<div class="post-metadata">

### Author: ![congyaan](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@congyaan](https://forum.kirupa.com/u/congyaan)
#### Post date: [June 20, 2008, 2:32am UTC](https://forum.kirupa.com/t/fullscreen-flash-problem-with-movieclip-positioning/263879/2 "2008-06-20T02:32:54Z")

</div>

at the beginning you can create two variable to store the Stage.width and Stage.height like this  
var stageWidth:Number = Stage.width;  
var stageHeight:Number = Stage.height;  
then in your code you just using stageWidth and stageHeight.  
the reason is Stage.width or Stage.height will be changed when you load in a external swf which is big then the main swf.
