title: ReferenceError SetInterval not defined
body: <p>Nearly all the SetInterval errors I've seen here on StackOverflow are due to passing a function name as a "string," but maybe I am still missing some sort of variable scope problem. Please advise!</p>
  
  <p>I'm creating a slideshow with pause and play capabilities. When playing, I want the slides to advance every 3 seconds. But the SetInterval to launch the NextSlide function is failing after executing once.</p>
  
  <p>I've tried it as...</p>
  
  <pre><code>SetInterval("nextSlide()", 3000)
  SetInterval(nextSlide(), 3000)
  var t = SetInterval(nextSlide(), 3000)
  var t = SetInterval(function(){nextSlide(), 3000)
  </code></pre>
  
  <p>... with failure every time. What am I missing here?</p>
  
  <pre><code>var slide_1 = "slide_1";
  var slide_2 = "slide_2";
  var slideNum = 0;
  var odd = true;
  var totalMax = 6;
  var busy = false;
  
  var allSlides = new Array();
  allSlides[0] = "test_01";
  allSlides[1] = "test_02";
  allSlides[2] = "test_03";
  allSlides[3] = "test_04";
  allSlides[4] = "test_05";
  allSlides[5] = "test_06";
  allSlides[6] = "test_07";
  
  function PlaySlide(){
  var t = SetInterval(nextSlide(),3000)
  document.getElementById("play").style.visibility = "hidden";
  document.getElementById("pause").style.visibility = "visible";
  }
  
  function nextSlide(){
  if(slideNum &lt; totalMax &amp;&amp; !busy){
  busy = true
  document.getElementById("loading").style.zIndex = 4;
  slideNum = slideNum + 1
  var slide = allSlides[slideNum]
  var link = "https://dl.dropboxusercontent.com/u/..." + slide + ".jpg"
  odd = !odd
  if(odd){document.getElementById(slide_1).src = link} //which &lt;img&gt;.onLoad lauches a fadeIn()
  else{document.getElementById(slide_2).src = link}
  }
  }
  </code></pre>