Skip navigation
    1 Reply Latest reply on Jun 21, 2011 8:48 AM by kglad

    Multiple onrelease functions (Contact form) submit and then go to next frame

    chrillesweden
      Hi!

       

      I have a problem with a contactform in flash.

      The form and the script works fine,

      but i want to add a function

       

      When pressing the "submit button" it sends me an email.
      And the text "message sent apears.

       

      I would like to add a onreleaseandgotoandplay function which takes me to the frame 2.

       

      i have tried to place this function into the button, it works fine taking me to frame 2, but then it does not send me an email....

       

      I guess the second function should be placed in the code below to work, someone who knows how to do this?

       

      Actionscript

       

      bSubmit.onRelease = function()
      {
      email();
      }
      function email()
      {
      var sMessage = "Name: " + tName.text + "\nE-mail: " + tEmail.text + "\nComments: " + tComments.text + "\nPhone: " + tPhone.text;
      lvSend = new LoadVars();
      lvReply = new LoadVars();
      lvSend.msg = sMessage;
      lvSend.address = "info@mail.com"; //Change this to your e-mail.
      tName.text = "Sending Message...";
      tEmail.text = "";
      tComments.text = "";
      tMobilen.text = "";
      lvReply.onLoad()
      {
      tName.text = "message sent";
      }
      lvSend.sendAndLoad('mail.php', lvReply, 'POST');
      }

       

       

       

        • 1. Re: Multiple onrelease functions (Contact form) submit and then go to next frame
          kglad Adobe Community Professional & MVP

          if you don't need a delay between "message sent" feedback and your goto, use:

           


           

          bSubmit.onRelease = function()
          {
          email();
          }
          function email()
          {
          var sMessage = "Name: " + tName.text + "\nE-mail: " + tEmail.text + "\nComments: " + tComments.text + "\nPhone: " + tPhone.text;
          lvSend = new LoadVars();
          lvReply = new LoadVars();
          lvSend.msg = sMessage;
          lvSend.address = "info@mail.com"; //Change this to your e-mail.
          tName.text = "Sending Message...";
          tEmail.text = "";
          tComments.text = "";
          tMobilen.text = "";
          lvReply.onLoad()
          {
          tName.text = "message sent";
          _root.gotoAndStop(2);  // if you need a delay, you can use setTimeout()
          }
          lvSend.sendAndLoad('mail.php', lvReply, 'POST');
          }

           

           

           

          1 person found this helpful

          More Like This

          Legend

          • Correct Answers - 10 points