Hey guys. I have a scrollbar for a movie clip (the full site) that appears and resizes according to the height of the mc and stage height.
I have it set to where if the height of the mc is smaller than the stage height, then center the mc on the x and y axis… So its centered on the stage…
But if the stage.height is smaller than the mc height, the scroll bar appears, and the mc_y is set to 0.
Everything so far works great, but if I start the site normally (stage.height > mc._height), then resize the browser so stage.height is smaller (the scrollbar appears), and then resize again to its normal position (stage.height > mc._height, no scrollbar), the scrollbar function still exists, and I can still scroll up and down with the click wheel and mc._y is set to 0… instead of stage.height/2….
Heres my function…
sizeListe = new Object();
sizeListe.onResize = initStage;
function initStage() {
//center the container on the stage
if (Stage.height>=680) {
site_mc._x = Stage.width/2;
site_mc._y = (Stage.height/2)-352.6;
scroller_mc._visible = false;
} else {
var w = Stage.width;
var h = Stage.height;
site_mc.init(20);
site_mc._y = 0;
site_mc._x = Stage.width/2;
scroller_mc._x = w;
scroller_mc._y = 0;
scroller_mc.updateScroll(site_mc._height+70);
}
}
//init the stageListe
Stage.addListener(sizeListe);
initStage();
this obviously does not work, because the scroll is still active from before, but I just wanted to know how I can fix this… Do I somehow clear the function?
Thanks!
Justin
Posted about 1 month ago