3 Replies Latest reply on May 7, 2006 7:52 AM by kglad

    wait function

    uxk8396 Level 1
      Hi,
      I am making use of wait function, but I am not sure where I am going wrong.
      The scenario is after typing your name in the input type box, you press the enter button. Then a message appears in the output text box: Hello "your name"

      After that I want to make use of wait function so that it waits for 5 seconds before it takes us to the welcome page.
      What is wrong with that code:

      t=wait(300);
      };
      if (wait>t) {
      _parent.gotoAndPlay("welcome");


      +++++++++++++++++++++++++++++++
      stop();
      enter_btn.onRelease = function() {
      if (input_txt.text == null || input_txt.text == "") {
      gotoAndStop("error");
      } else {
      output_txt.text = "Hello "+input_txt.text+"! I hope you will enjoy this Experimental website on Henry Matisse.";
      }
      t=wait(300);
      };
      if (wait>t) {
      _parent.gotoAndPlay("welcome");
      }
      //
      wait = function (m) {
      startTime = getTimer();
      i = 0;
      do {
      currentTime = getTimer();
      i = currentTime-startTime;
      } while (i<m);
      };
      +++++++++++++++++++++++++++++++++++

      Thanking you in advance,
      Uti