I am using a full size background on my website with the following code.
Stage.align = "TL";
Stage.scaleMode = "noScale";
bg.onResize = function() {
var imageAspectRatio = this._width/this._height;
var stageAspectRatio = Stage.width/Stage.height;
if (stageAspectRatio>=imageAspectRatio) {
this._width = Stage.width;
this._height = Stage.width/imageAspectRatio;
} else {
this._height = Stage.height;
this._width = Stage.height*imageAspectRatio;
}
_root._x = Stage.width/2;
_root._y = Stage.height/2;
};
Stage.addListener(bg);
bg.onResize();
The problem any swfs that I load into are not centered because of the Stage.align = “left”;
So I adjusted all loaded swfs like so.
_root._x = 200;
_root._y= 100;
Which center my movie perfectly. The problem is when I try my movie on
other resolutions the movie is no longer centered? Do I need to write
some code that gets the screen resolution and adjusts the _root based
on screen resolution? Is there a better way? I can write the code but
how many possible resolutions are there?