so, i finally got the fullscreen / scaling background to work. AND i can add .swf’s and other mc’s over top of it without any problem. however, i want to be able to have the background image randomly generated. i know how to do that on its own, but i can’t get it to work with this script. any advice?
here’s my fullscreen / scaling bg script.
Stage.scaleMode = “noScale”;
_global.imgConstantWidth = bgImage._width;
_global.imgConstantHeight = bgImage._height;
setImage = function(mc){
var originalWidth = 1280;
var originalHeight = 850;
var widthGutter = (Stage.width - originalWidth)/2;
var heightGutter = (Stage.height - originalHeight)/2;
mc._x = -widthGutter;
mc._y = -heightGutter;
if (mc._width > Stage.width){
mc._x -= (mc._width-Stage.width)/2;
}
if (mc._height > Stage.height){
mc._y -= (mc._height-Stage.height)/2;
}
}
resizeImage = function(mc){
var scaleByWidth;
if (Stage.width/Stage.height > _global.imgConstantWidth/_global.imgConstantHeight){
scaleByWidth = true;
}else{
scaleByWidth = false;
}
if (scaleByWidth){
mc._height = Stage.width * _global.imgConstantHeight / _global.imgConstantWidth;
mc._width = Stage.width;
} else {
mc._width = Stage.height * _global.imgConstantWidth / _global.imgConstantHeight;
mc._height = Stage.height;
}
}
setImage(bgImage);
resizeImage(bgImage);
sizeListener = new Object();
sizeListener.onResize = function() {
setImage(bgImage);
resizeImage(bgImage);
};
Stage.addListener(sizeListener);