4 Replies Latest reply on Jul 8, 2007 10:40 AM by kglad

    Help with a simple pause-code function

    sr817
      For a week I've been trying to figure out a simple pause-code function fror AS 3.0. I need something that pauses AS code for set amounts of time. People have tried to help me on this forum, but I've still not been able to make the code work.

      Here is what I have at the moment for pause-code (not working):

      var intID;
      intID = setInterval(delay, 3000); //this tells flash to wait 3 seconds
      function delay(){
      clearInterval(intID);
      _root.gotoAndPlay(1); // or do something else...
      }

      The person who supplied me with this code did not include the first line "var intID", but as a new flash user, I wasn't sure how else to declare intID. Could someone with some flash experience walk me through the steps of creating a pause-code function or add to the one I have already provided. When I use the above code in my flash document, the pause feature does not work at all. It essentially skips over the setInterval and clearInterval functions and plays the root clip in delay(). I need code meant for AS 3.0 and I'm becoming increasingly desperate for a response.

      I hope this is understandable and thank you for taking a look,
      Sam