0 Replies Latest reply on Apr 24, 2013 6:37 AM by JohnG103

    setTimeout / clearTimeout Question

    JohnG103

      I have a project that has to show a series of video clips one after another and also allow jumping between them randomly using previous and next buttons. I set up a timer set to the running time of each video that plays the clip and then goes to the frame containing the next video. This works fine until the "previous" or "next" buttons are clicked before the timer runs out.

       

      For example, if while viewing video 1 you click the "next" button to advance to video 2 and then jump back to video 1 before its timer runs out, video 1 only plays for the amount of time left on the timer.

       

      This is what I'm using for the timer:

       

      setTimeout(function() {sym.play("vid2");}, 32000);

       

       

      I need a way to reset or clear the timer before the next video plays. I assume that means using clearTimeout but I can't figure out how or where to put it.

       

      Hope that's clear. Any help would be appreciated.

       

      Thanks!