Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

custom scrollbar - can't figure out 1

Status
Not open for further replies.

whoknows361

Technical User
Sep 22, 2005
228
US
hello all. I have created a custom scrollbar - but I can't figure out why the up buttom scrolls past the maincontent movieclip.

I have tried a number of fixes, but can't seem to figure out the problem. Please download the fla below & see that my scrollface & scrolltrack & down arrow work - but when you click on the up arrow once - it scrolls past the main content.

Would really appreciate any guidance. Thanks
Jonathan
here's the file
 
following changes do the trick

final = contentMain._y
offset = maskedView._y - contentMain._y

btnUp.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._y+speed<maskedView._y-offset) {
if (scrollFace._y<=top) {
scrollFace._y = top;
} else {
scrollFace._y -= speed/moveVal;
}
contentMain._y += speed;
} else
scrollFace._y = top;
contentMain._y = final
delete this.onEnterFrame;
}
};
};

 
thanks so much Bill = I didn't even recognize the offset value!

Once last question - perhaps can you tell me why when you click on the up button once, the entire scrollbar continues until it reaches the top & text scrolls up until it reaches the top. ?

Thanks again for the previous assistance.
Jonathan
 
its these two lines that make it scroll all the way

this.onEnterFrame = function() {
if (contentMain._y+speed<maskedView._y-offset) {

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top