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 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!