3 Replies Latest reply on Apr 22, 2006 8:49 AM by kglad

    function under condition

    chulimanga
      Hi everybody,
      could you help me with this?:

      On root timeline I have a button with this script:

      on (rollOver) {_root.fast = true}
      on (rollOut) {_root.fast = false}

      and one movie clip with motion tween inside.

      I would like to control speed of that tween with described button. Above every frame of tween inside mc is this script:

      if (_root.fast = true){
      function timelineFaster() {
      nextFrame();
      updateAfterEvent();
      }
      var tweenFaster:Number = setInterval(timelineFaster, 42);
      } else {
      function timelineFaster()
      { nextFrame();
      updateAfterEvent();
      }
      clearInterval(tweenFaster);
      play();
      }

      This function works perfectlly standalone, but with condition doesn't. Have any idea? Thanks for anything in advance.

      chulimanga