CODE
...
mButton.onmousedown = function()
{
this.myButtonDown = true;
this.onmouseup = function()
{
this.myButtonDown = false;
}
while( this.myButtonDown == true )
{
var theNum = this.id.substr(0,1);
cColor[theNum]++;
var myBox = my_getbyid( theNum + 'Color' );
myBox.value = cColor[theNum];
this.myClass.update_preview();
}
}
...
mButton.onmousedown = function()
{
this.myButtonDown = true;
this.onmouseup = function()
{
this.myButtonDown = false;
}
while( this.myButtonDown == true )
{
var theNum = this.id.substr(0,1);
cColor[theNum]++;
var myBox = my_getbyid( theNum + 'Color' );
myBox.value = cColor[theNum];
this.myClass.update_preview();
}
}
...
I'm pretty sure I'm doing something wrong. I'm just not sure what's the right way of doing this, since I'm not that good with JavaScript. Is there a DoEvents thign I can use in my loop? Something else?