# Full screen code bottom right not top left

**URL:** https://forum.kirupa.com/t/full-screen-code-bottom-right-not-top-left/256502
**Category:** flash
**Created:** [April 3, 2008, 4:31pm UTC](https://forum.kirupa.com/t/full-screen-code-bottom-right-not-top-left/256502 "2008-04-03T16:31:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![keith\_chegwin](https://avatars.discourse-cdn.com/v4/letter/k/dbc845/32.png) [@keith\_chegwin](https://forum.kirupa.com/u/keith_chegwin)
#### Post date: [April 3, 2008, 4:31pm UTC](https://forum.kirupa.com/t/full-screen-code-bottom-right-not-top-left/256502/1 "2008-04-03T16:31:34Z")

</div>

How can i get a Background picture to be full screen in Flash and then anchor the top left when resizing?

At the moment it anchors bottom right. My code is below.

> 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;
}

this._x = Stage.width/2;
this._y = Stage.height/2;

```

};  
Stage.addListener(bg);  
bg.onResize();
