I am quite familiar with JavaScript and many other programming
languages as I am a programmer for a living. However, I am having a
heck of a time figuring out this problem. I would like to have a
function loop as long as the mouse button is pressed. I am aware of the
onMouseDown event to fire the loop, but I cann't figure out how to stop
the loop with the onMouseUp event.

I have tried setting a boolean value with the onMouseDown event, but
once I release the mouse button, the boolean value cannot be changed
until the loop is done. So, as the loop is waiting for the value to be
changed, it becomes an infinite loop. Many people have offered
suggestions, but none of them seem to work.

Is there such a method as whileMouseDown, or is it possible to cancel a
function with onMouseUp?

This must be possible.... I am basically trying to scroll through an
image hidden behind a division, much like scrolling through a web page.
When you hold down the arrow key, it scrolls until you let go...

I would greatly appreciate any help anyone can offer. I am using IE 6.0
and I will include a code sample of what I have been doing:

var ismousedown=0;

document.onmousedown = mouseDown;
document.onmouseup = mouseUp;

function mouseDown()
{
ismousedown = 1;
}
function mouseUp()
{
ismousedown = 0;
}
function getMouseValue()
{
return ismousedown;
}
function checkMouse()
{
if(getMouseValue == 0)
{

}else
{
moveDown();
setTimeout("checkMouse()",500);
}
}