# Placement In Flash

**URL:** <https://forum.kirupa.com/t/placement-in-flash/187048>\
**Category:** flash\
**Created:** [April 26, 2006, 12:07pm UTC](https://forum.kirupa.com/t/placement-in-flash/187048 "2006-04-26T12:07:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mickey\_cakes](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@mickey\_cakes](https://forum.kirupa.com/u/mickey_cakes)\
**Post date:** [April 26, 2006, 12:07pm UTC](https://forum.kirupa.com/t/placement-in-flash/187048/1 "2006-04-26T12:07:28Z")

</div>

i have a problem… i have a bg image that stretches 100% with a radial gradiant and i have a mc that i want to stay centered on top of that. i have to use the Stage.align = “LT” ; for the 100% bg but when i use it, it doesnt let the MC on the other layer stay centered in the movie when resized? make sense?

Here is the 100% bg code [INDENT]Code:

Stage.align = “LT”;

Stage.scaleMode = “noScale”;

bg.onResize = function() {

```
var imageAspectRatio = this._width/this._height; 

var stageAspectRatio = Stage.width/Stage.height; 

if (stageAspectRatio&gt;=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();

[/INDENT]

and here is the code from from a friend for the Centered MC  
[INDENT]Code:

var sListen:Object = new Object();

Stage.addListener(sListen);

sListen.onResize = function():Void {

// move your stuff here

// based on Stage.width and Stage.height

}

sListen.onResize();

[/INDENT]  
I need to pretty much combine the 2 i guess or just modify one of the codes so that it doesnt counteract with the other…make sense…

any help would be much appreciated…thanks

jake
