I’m trying to achieve a fluid, full screen background setup with the code below. The problem I’m having is that when I view the file (both in Flash and via all browsers), I’m not able to see the background image. It’s only when I resize my browser that the background image appears. Do I have some conflicting code that could be causing this? Anyone know of a possible fix?
stop();
Stage.scaleMode = "noscale";
Stage.align ="TL";
_root.bg_mc.inside.loadMovie("weddingone.swf");
bottomright._x = Stage.width
bottomright._y = Stage.height - bottomright._height
bottomleft._y = Stage.height - bottomleft._height
topmenu._y = Stage.height - topmenu._height
topright._x = Stage.width - topright._width
center._x = (Stage.width + 800)/2
center._y = Stage.height/2
sizeListener = new Object();
sizeListener.onResize = function() {
bottomright._x = Stage.width
bottomright._y = Stage.height - bottomright._height
bottomleft._y = Stage.height - bottomleft._height
topmenu._y = Stage.height - topmenu._height
topright._x = Stage.width - topright._width
center._x = (Stage.width + 800)/2
center._y = Stage.height/2
};
Stage.addListener(sizeListener);
var sListen:Object = new Object();
sListen.onResize = function() :Void {
rePosition(bg_mc);
};
Stage.addListener(sListen);
function rePosition(clip:MovieClip) :Void {
if(Stage.width/Stage.height>clip._width/clip._height) {
clip._width = Stage.width;
clip._yscale = clip._xscale;
} else {
clip._height = Stage.height;
clip._xscale = clip._yscale;
}
clip._x = Stage.width / 2;
clip._y = Stage.height /2;
};
rePosition(bg_mc);