1 Reply Latest reply on Jul 4, 2006 6:38 PM by Craig Grummitt

    Delay timer

    JstMrd Level 1
      Hello,

      Is there a simple way to generate a delay within a function. I am trying to create a typewriter simulation of text, but require a delay when the next letter is chosen. I have tried using a standard for loop, which should technically work. But it creates one big delay then displays the result.

      thanks
        • 1. Re: Delay timer
          Craig Grummitt Level 3
          the flaw in your code is that the stage is updated every frame, and all your code is contained within one frame i.e. all of your letters have to be added to your dynamic text box variable before it gets displayed.

          What you'd be after is either an onEnterFrame which performs an action every frame, or probably even better would be setInterval which performs an action every x milliseconds: