# Full-screen resize - code check

**URL:** https://forum.kirupa.com/t/full-screen-resize-code-check/211134
**Category:** flash
**Created:** [December 27, 2006, 8:17pm UTC](https://forum.kirupa.com/t/full-screen-resize-code-check/211134 "2006-12-27T20:17:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![hmmaah](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@hmmaah](https://forum.kirupa.com/u/hmmaah)
#### Post date: [December 27, 2006, 8:17pm UTC](https://forum.kirupa.com/t/full-screen-resize-code-check/211134/1 "2006-12-27T20:17:58Z")

</div>

Hello people,

I’ve got a browser competibility problem with a bit of code I picked up from a tutorial on another site. I’m trying to make a flash movie that resizes the background to the size of the browser. The code I am using does this, but only in one browser. I haven’t even checked it on a PC yet, so not sure how safe I am with this one.

Below the code - do any of you know a more water-tight way to do the same thing? Or have I made a mistake somewhere?

Any help would be brilliant.

The site is posted here: [www.anrick.com](http://www.anrick.com).

* * *

Stage.scaleMode = “noScale”;

var HPositioner:Number = (Math.round((Stage.width - 640) / 2));  
var VPositioner:Number = (Math.round((Stage.height - 480) / 2));

function HPositionMenu () {  
var HPositioner:Number = (Math.round((Stage.width - 640) / 2));  
setProperty(menu, \_x, 0 - HPositioner);  
}

function VPositionMenu () {  
var VPositioner:Number = (Math.round((Stage.height - 480) / 2));  
setProperty(menu, \_y, 0 - VPositioner);  
}

HPositionMenu();  
VPositionMenu();

setProperty(bg\_mc, \_width, Stage.width);  
setProperty(bg\_mc, \_height, Stage.height);

var resizeListener:Object = new Object();  
Stage.addListener(resizeListener);

resizeListener.onResize = function () {  
setProperty(bg\_mc, \_width, Stage.width);  
setProperty(bg\_mc, \_height, Stage.height);  
HPositionMenu();  
VPositionMenu();  
}

* * *
