# Mc isn't located orrectly until browser is resized

**URL:** https://forum.kirupa.com/t/mc-isnt-located-orrectly-until-browser-is-resized/322927
**Category:** Uncategorized
**Created:** [June 8, 2011, 9:21pm UTC](https://forum.kirupa.com/t/mc-isnt-located-orrectly-until-browser-is-resized/322927 "2011-06-08T21:21:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![littlerach](https://avatars.discourse-cdn.com/v4/letter/l/6de8d8/32.png) [@littlerach](https://forum.kirupa.com/u/littlerach)
#### Post date: [June 8, 2011, 9:21pm UTC](https://forum.kirupa.com/t/mc-isnt-located-orrectly-until-browser-is-resized/322927/1 "2011-06-08T21:21:35Z")

</div>

Hi All,

New to posting on Kirupa. I do read through older posts and threads for help but I haven’t found a great answer to my little problem, so I thought I’d post.

I have a full-browser flash site, with a movie clip horizontal nav bar at the bottom of the page. I’ve got everything working well (the background rescaling to fill the browser when the browser window size changes, the horizontal nav bar at the bottom…) for the most part. One thing is really getting to me however. Check out the example I made here: [http://www.rachelahampton.com/mon.html](http://www.rachelahampton.com/mon.html) Upon loading, the nav bar sits in the middle of the page. The moment you re-size the browser, it pops into the desired location near the bottom and stays there, even if you continue to re-size. However I want it to appear where it should at the bottom of the window on page load, without having to re-size the browser window. In the following code, main is the placeholder for the image slideshow that runs in the full browser, menu\_mc is the menu.

i[SIZE=1]mport com.greensock.TweenLite;  
import fl.motion.easing.\*;  
import flash.events.MouseEvent;

[/SIZE][SIZE=1]//set stage for FBF  
//set stage for FBF  
stage.align = “TL”;  
stage.scaleMode = “noScale”;  
//define dynamic aspect ratios  
var mainHeight = main.height / main.width;  
var mainWidth = main.width / main.height;  
//add event listener to the stage  
stage.addEventListener(Event.RESIZE, sizeListener);  
//conditional statement to account for various initial browswer sizes and proportions  
function scaleProportional():void {  
if ((stage.stageHeight / stage.stageWidth) \< mainHeight) {  
main.width = stage.stageWidth;  
main.height = mainHeight \* main.width;  
} else {  
main.height = stage.stageHeight;  
main.width = mainWidth \* main.height;  
};  
}  
//center picture on stage  
function centerPic():void {  
main.x = stage.stageWidth / 2;  
main.y = stage.stageHeight / 2;  
}  
// make listener change picture size and center picture on browser resize  
function sizeListener(e:Event):void {  
scaleProportional();  
centerPic();  
}  
//run initial locations and size  
scaleProportional();  
centerPic();

stage.addEventListener(Event.RESIZE, resizeListener);

function resizeListener (e:Event):void {  
menu\_mc.x = 960;  
menu\_mc.y = stage.stageHeight-75;  
}

TweenLite.to(main, 1, {alpha:1});  
TweenLite.to(menu\_mc, 1, {alpha:1});[/SIZE]

Thanks in advance!
