1 Reply Latest reply on May 19, 2008 9:29 AM by UdoGre

    Lock the movie with waiting time

    Level 7
      Hello:
      Can you help me with this code, please?

      The wait handler stop my movie and I can't interact with the application.
      Thank you.

      on mouseUp me
      global gOutConnected
      global xm
      if (gOutConnected) then
      Instrum=5
      Channel=1
      --Chord A6
      sendProgramChange(xm, Channel, Instrum) --
      C3=64
      E3=68
      G3=71
      A3=73

      --play notes
      sendNoteOn(xm, Channel, C3, 90)
      wait 1
      sendNoteOn(xm, Channel, E3, 90)
      wait 1
      sendNoteOff(xm, 1, C3, 90)
      end

      on wait numTicks
      set startTime =the ticks
      repeat while the ticks < startTime + (numTicks*60)
      nothing
      end repeat
      end


        • 1. Re: Lock the movie with waiting time
          UdoGre
          Hi Arielle,

          Director does exactly what you told it: Execute the repeat loop as fast as possible, and do nothing. You must never create a repeat loop like this, running for more than a few ms.
          If you search the forum, you will find that an estimated 20% of users fall for this once.

          You can check your time in an exitframe-handler, or create a timeout-object.

          HTH,

          Udo