Full-screen resize - code check

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.


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();
}