Screen resolution question

Hey guys,

I have been playing with this code for a couple of days and I am getting “decent” results but not consistant. Basically I want to get the users resolution and divide it by the optimun resoultion and scale the page.

What I am trying to attempt is that items stay the same size regardless of resolution. I realize that I will get some distortion but when testing the distortion doesn’t seem to effect the overall look of the page. If i stay away from really small fonts I seem ok. Regardless you get some distortion in lower resolution anyways.

Here is the code.

var userResX:Number = System.capabilities.screenResolutionX;
var noXScaleRes:Number = 1440;
var swfXSize:Number = 1000;//stage width
var thisXRes:Number = ((userResX / noXScaleRes) * 100);
var xCntr:Number = (swfXSize / 2) - (((thisXRes * swfXSize) / 100) / 2);
    _root._x = xCntr;
    _root._xscale = thisXRes;
var userResY:Number = System.capabilities.screenResolutionY;
var noYScaleRes:Number = 900;
var swfYSize:Number = 600;//stage height
var thisYRes:Number = ((userResY / noYScaleRes) * 100);
var yCntr:Number = (swfYSize / 2) - (((thisYRes * swfYSize) / 100) / 2);
    _root._y = yCntr;
    _root._yscale = thisYRes;

Now when I test on resolutions with similar aspect ratios 1.7 as the optimum resolution the content scales to respectable “result”.

But when the aspect ratio is closer to 1 to 1 I don’t it squares my content.

Sinse I am handling the x and y seperate I am not sure why it would?

Let me say I am not a web designer or develepor nor do I have a desire to be. I do this for fun and I love the medium. I am sure there must be some logical reason why code to do this has not been attempted. Atleast I couldn’t find it.

Thanks.