3 Replies Latest reply on Jun 6, 2006 7:05 AM by kglad

    Scenes

    Snej
      I have a form for people to fill out. If they make a mistake in a field some text above the field will inform about the mistake and they will be sent to a certain scene to watch a video explaining what they did wrong.

      As you will see on the script below the informing text above the wrongly fulfilled fields works fine. However I cannot make the jumps to the correct scenes work. Any help is appreciated. As you can see, the lname_ff=2 part is not that elegant…and it doesn’t work :-( Sincerely Jens

      Script for send button:
      submit_btn.onRelease = sendMessage;
      error2_txt.autoSize = true;
      error3_txt.autoSize = true;
      error4_txt.autoSize = true;

      Script for first scene:
      function checkForm():Boolean {
      var missing:Boolean = false;
      _level0.error2_txt.text=error3_txt.text=error4_txt.text="";

      if (lname_txt.text == "") {
      lname_ff = 2;
      _level0.error2_txt.text = "Please enter your name";
      missing = true;
      }
      if (email_txt.text.indexOf("@") == -1) {
      email_ff = 2;
      _level0.error3_txt.text = "Please enter a valid email address";
      missing = true;
      }
      if (comments_txt.text == "") {
      _level0.error4_txt.text = "You have not entered any comments";
      comments_ff = 2;
      missing = true;
      }
      if (email_ff == 2) {
      gotoAndPlay("CorrectFirstName");
      }
      if (email_ff == 2) {
      gotoAndPlay("CorrectEmail");
      }
      if (comments_ff == 2) {
      gotoAndPlay("EnterComments");
      }
      return missing ? false : true;
      }