2 Replies Latest reply on Jun 27, 2006 5:55 PM by jthereliable

    wait until a variable change!

    Andrew20 Level 1
      I got a menu are movie clips and when I click on another section, the fist sub menu will closed animated. So I want this animation to be finish before the other sub menu open. So at the end of the animation I put a variable = true

      but I don't know to use it, the only way I found is to do this, but it's not perfect, because it use a lot of memory

      function FinDuCloseMenu() {
      for (i=0; i<10000; i++) {
      if (_global.menuferme==true) {i=10000}
      }
      }
        • 1. Re: wait until a variable change!
          Rothrock Level 5
          And on some machines I think this code will give the dreaded "script error" and ask the user if they want to abort the code.

          Check out watch() in the help documents. It allows you to do things when the value of a variable is changed.
          • 2. Re: wait until a variable change!
            jthereliable
            Well, I don't understand your problem right here. Is the submenu dynamically built or something?
            If it was an animation, why not put at the end of the animation, something like:
            _root.openedMenu=false

            And at the frame of where everything is in (the _root area), put:
            _root.openedMenu=false

            Then in the first frame of the animation, do this (in code)

            I hope this helps!