# Full scale background problem

**URL:** <https://forum.kirupa.com/t/full-scale-background-problem/193253>\
**Category:** flash\
**Created:** [July 10, 2006, 4:13am UTC](https://forum.kirupa.com/t/full-scale-background-problem/193253 "2006-07-10T04:13:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![artistwantab](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@artistwantab](https://forum.kirupa.com/u/artistwantab)\
**Post date:** [July 10, 2006, 4:13am UTC](https://forum.kirupa.com/t/full-scale-background-problem/193253/1 "2006-07-10T04:13:53Z")

</div>

I am using a full size background on my website with the following code.

```auto
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?
