# Full browser flash: mc not fitting stage

**URL:** <https://forum.kirupa.com/t/full-browser-flash-mc-not-fitting-stage/224869>\
**Category:** flash\
**Created:** [May 6, 2007, 3:54pm UTC](https://forum.kirupa.com/t/full-browser-flash-mc-not-fitting-stage/224869 "2007-05-06T15:54:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DOOJ](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@DOOJ](https://forum.kirupa.com/u/DOOJ)\
**Post date:** [May 6, 2007, 3:54pm UTC](https://forum.kirupa.com/t/full-browser-flash-mc-not-fitting-stage/224869/1 "2007-05-06T15:54:23Z")

</div>

Hi.

This is doing my head in.  
I have a movieclip “myBacking\_mc” that expands to fit the browser window. However, it’ll only expand to fit if I manually adjust the size of the browser: maximise it, or just adjust it’s size by one pixel.  
Obviously that’s rubbish.

How do I make the movieclip “myBacking\_mc” expand to fit the size of the browser window automatically when the page loads?

My Actionscript is below. Not very tidy I suspect as I’m pretty much making it up as I go along, but it does the job apart from this one last thing.  
Thanks everyone.

```auto
stop();
Stage.scaleMode = "noscale";
Stage.align = "tl";
Stage.addListener({onResize:reposition});
function reposition() {
    var header = _root.myHeader_mc;
    var content = _root.myContent_mc;
    var footer = _root.myFooter_mc;
    var nPos;
    nPos = getNewPosition(header);
    header._x = nPos.x;
    header._y = 0;
    nPos = getNewPosition(content);
    content._x = nPos.x;
    content._y = nPos.y;
    nPos = getNewPosition(footer);
    footer._x = nPos.x;
    footer._y = Stage.height-footer._height;
}
function getNewPosition(mc) {
    var newX = Math.floor((Stage.width-mc._width)/2);
    var newY = Math.floor((Stage.height-mc._height)/2);
    return {x:newX, y:newY};
}
reposition();

stageListener = new Object();
stageListener.onResize = function() {
    expandBacking();
};
Stage.addListener(stageListener);
expandBacking = function () {
    myBacking_mc._width = Stage.width;
    myBacking_mc._height = Stage.height;
};

```
