# Scrollbox stage.height problem

**URL:** <https://forum.kirupa.com/t/scrollbox-stage-height-problem/268661>\
**Category:** Uncategorized\
**Created:** [August 16, 2008, 10:30pm UTC](https://forum.kirupa.com/t/scrollbox-stage-height-problem/268661 "2008-08-16T22:30:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![boygeniuss](https://avatars.discourse-cdn.com/v4/letter/b/e19b73/32.png) [@boygeniuss](https://forum.kirupa.com/u/boygeniuss)\
**Post date:** [August 16, 2008, 10:30pm UTC](https://forum.kirupa.com/t/scrollbox-stage-height-problem/268661/1 "2008-08-16T22:30:42Z")

</div>

hey whats going on everybody? im having a little problem with my flash site im trying to build. inside my site i have a scroll box that loads data from a xml file, i set the mask and scroll bar of the scroll box to stage.height and it works perfectly, but here comes the problem, the scroll bar that you drag in order to display more data goes past the stage height. right here is a example of whats going on. [www.directcorner.com/rp/est.html](http://www.directcorner.com/rp/est.html)  
and here is the code inside the scrollbox:

Stage.align = “TL”;  
Stage.scaleMode = “noScale”;  
stop ();  
scrollBar.\_height = Stage.height;  
toScroll = “item\_mc”;  
scroll\_mc.setMask(mask\_mc);  
mask\_mc.\_height = Stage.height;  
sizeListener = new Object();  
sizeListener.onResize = function() {  
mask\_mc.\_height = Stage.height;  
scrollBar.\_height = Stage.height;  
};  
Stage.addListener(sizeListener);  
for (i = 0; i \< total; i++)  
{  
scroll\_mc.item\_mc.item.duplicateMovieClip(“item” + i, i);  
scroll\_mc.item\_mc[“item” + i].\_y = scroll\_mc.item\_mc[“item” + i].\_height \* i;  
scroll\_mc.item\_mc[“item” + i].headline\_txt.text = headline\*;  
scroll\_mc.item\_mc[“item” + i].date\_txt.text = date\*;  
scroll\_mc.item\_mc[“item” + i].intro\_txt.text = copy\_intro\*;  
scroll\_mc.item\_mc[“item” + i].intro\_txt.html = true;  
scroll\_mc.item\_mc[“item” + i].intro\_txt.htmlText = copy\_intro\*;  
loadMovie(image\_thumb\*, scroll\_mc.item\_mc[“item” + i].holder);  
scroll\_mc.item\_mc[“item” + i].holder.\_alpha = 0;  
scroll\_mc.item\_mc[“item” + i].image\_large = image\_large\*;  
scroll\_mc.item\_mc[“item” + i].copy\_txt.text = copy\_full\*;  
scroll\_mc.item\_mc[“item” + i].copy\_txt.html = true;  
scroll\_mc.item\_mc[“item” + i].copy\_txt.htmlText = copy\_full\*;  
} // end of for  
scrollTween = 5;  
scrollSpeed = 6;  
scrollBttn.originY = scrollBttn.\_y;  
scrollBttn.originX = scrollBttn.\_x;  
scrollBttn.maxY = scrollBar.\_height - scrollBttn.\_height + scrollBttn.originY;  
scroll\_mc.originY = scroll\_mc.\_y;  
var mouseListener = new Object();  
mouseListener.onMouseWheel = function (wheelNum)  
{  
if (scrollBttn.\_y \>= scrollBttn.originY)  
{  
scrollBttn.\_y = scrollBttn.\_y - wheelNum / scrollRatio \* scrollSpeed;  
if (scrollBttn.\_y \< scrollBttn.originY)  
{  
scrollBttn.\_y = scrollBttn.originY;  
}  
else if (scrollBttn.\_y \> scrollBttn.originY + scrollBar.\_height - scrollBttn.\_height)  
{  
scrollBttn.\_y = scrollBttn.originY + scrollBar.\_height - scrollBttn.\_height;  
} // end if  
} // end else if  
};  
Mouse.addListener(mouseListener);  
onEnterFrame = function ()  
{  
scrollRatio = scroll\_mc[toScroll].\_height / scrollBar.\_height;  
ratio = (scroll\_mc[toScroll].\_height - scrollBar.\_height) / (scrollBar.\_height - scrollBttn.\_height);  
if (scroll\_mc[toScroll].\_height \> scrollBar.\_height)  
{  
destScroll = (-scrollBttn.\_y + scroll\_mc.originY) \* ratio + scroll\_mc.originY;  
scroll\_mc.\_y = scroll\_mc.\_y + Math.round((destScroll - scroll\_mc.\_y) / scrollTween);  
} // end if  
};  
stop ();

idk maybe im doing something wrong but can someone please help me. thanks
