Hi,
hoping someone can help me with my code

I want my background image to resize so that when a browser window is resized, the image scales with the width of the browser window (centre of the stage)

here is my code so far that does the job:

stage.scaleMode=StageScaleMode.NO_SCALE;
stage.align=StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, onStageResize);
addEventListener(Event.ENTER_FRAME, onFrame);

function onStageResize(evt:Event):void {
backgroundimg.scaleX=stage.stageWidth/1280;
backgroundimg.y=stage.stageHeight/2-backgroundimg.height/2;
backgroundimg.scaleY = backgroundimg.scaleX;

}


This is where I am stuck:

The minimum I want the image to scale to 900px... how do I set it so that the image doesn't resize further than 900px wide?

hope this makes sense! many thanks