Question : DHTML's Window.SetInterval HELP

Ok I'm using VBScript and DHTML.

I have a script that runs the
window.setinerval "Functionname", 1000

Now don't copy and paste the help from the DHTML on the syntax because it doesn't work.

Once I set this interval it goes on forever. I want it to stop so I want to use the clearInterval to stop it.

However, you can't use the clearInterval unless you give the setInterval an ID. But the syntax for giving the setinterval and ID doesn't work. It might be for JavaScript, but I'm using VBScript. I'm doing this in InterDev.

Here's the syntax for the SetInterval.

Syntax:
intervalID = object.setInterval(expression, msec [, language])
Thier Example:
setInterval("changeColor()", 5000);
Example that works:
window.setInterval "Count", 10
(I'm using VBScript)

If notice they have an IntervalID = setinerval but I can't get that to work, that's my problem.

Because clearinterval syntax is:
object.clearInterval(intervalID)

Any ideas?

   

Answer : DHTML's Window.SetInterval HELP

Function FocusIn()
'Run the Count Function every 10msec
Dim IntervalId
IntervalId = window.setInterval "Count ", 10
End Function

Function ClearOut()
  window.clearInterval(IntervalId)
End Function

These should work.
Random Solutions  
 
programming4us programming4us