1 Reply Latest reply on Oct 21, 2009 9:26 AM by Adamcbrz

    Sending variables to ASP using AS2 - Please help

    latoyale27 Level 1

      Hello,

       

      I am at my wits end . I have been trying for the last two days to get flash to pass variables to ASP with no luck.  If anyone has any suggestions please please please help.

       

      Thank you

       

      CODE  - FLASH

       

      submit_btn.onRelease = function() {
      emailform = new LoadVars();
      emailform.var1 = var1.text;
      emailform.var2 = var2.text;
      emailform.sendAndLoad("form.asp",form.asp,"GET");
      submit_btn.addEventListener(MouseEvent.CLICK,submit);
      gotoAndStop("thanks");
      };

       

       

      CODE ASP

       

      <%
      Dim var1, var2
      var1 = Request.Form("var1")
      var2 = Request.Form("var2")
      %>
      <html>
      <head>
          <title>Test flash transfer</title>
          
      </head>
      <body>
      <%
      Response.Write("Display Var 1" & var1 & "!<br />")
      Response.Write("Display Var 2" & var2 & "!<br />")
      %>

      </body>
      </html>

        • 1. Re: Sending variables to ASP using AS2 - Please help
          Adamcbrz Level 2

          Some of you flash doesn't make sense to me but i will help where I can.

           

          First off in you asp change your Request.Form to Request.QueryString then test your asp file to make sure that it is getting those variables before going to flash.

           

          so go to http://yourdomain.com/testaspfile.asp?var1=test&var2=test

          If everything outputs correctly there then we can move on to see what the problem with the flash is. If this doesn't work then you need to address why the asp by itself isn't working.

           

          On the flash side most of it looks good but i am not sure why you have an onRelease on the submit_btn then one it is clicked you add a eventListener for a click then goto the frame "thanks". That doesn't really make since to me but it might work in the big picture of your flash.

           

          Hope this helps and let me know if you need any more help.

           

          Thanks,

          Adam