One step further scroll bar

I’m trying to go another step further in the scroll bar tutorial:

Scroll Bar Tutorial @ Kirupa.com
ActionScript on page 3.

What I want is the arrow buttons to be invisible (btnUp._visible = “false”) when clicking them would do nothing. For example, if you are scrolled to the top of the page, the up arrow would be invisible. If you scrolled all the way to the bottom the down arrow would be invisible. I of course want them to become visible again when you can scroll one way or the other.