3 Replies Latest reply on Nov 25, 2009 1:52 PM by Baal Bebb

    Help with code to send to PHP script

    Baal Bebb

      For some reason my ActionScript code isn't working correctly. Would someone please tell me if this looks valid to send to a php processing script?

       

      var submitListener:Object = new Object();

       

      submitListener.click = function(evt:Object) {
         
      fname2 = fname.text;
      lname2 = lname.text;

       

      var send_lv:LoadVars = new LoadVars();

       

      send_lv.fname = fname.text;
      send_lv.lname = lname.text;
      send_lv.email = email.text;
      send_lv.dept = dept.text;
      send_lv.campus = campus.text;
      send_lv.uaid = uaid.text;
      send_lv.phone = phone.text;

       

      send_lv.send("process.php", _self, "POST");

       

      gotoAndStop("certificate");
      };

       

      thanks!

      -sage

        • 1. Re: Help with code to send to PHP script
          kglad Adobe Community Professional & MVP

          that's not valid.

           

          try:

           


           

          var submitListener:Object = new Object();

           

          submitListener.click = function(evt:Object) {
             
          fname2 = fname.text;
          lname2 = lname.text;

           

          var receive_lv:LoadVars=new LoadVars()

          var send_lv:LoadVars = new LoadVars();

           

          send_lv.fname = fname.text;
          send_lv.lname = lname.text;
          send_lv.email = email.text;
          send_lv.dept = dept.text;
          send_lv.campus = campus.text;
          send_lv.uaid = uaid.text;
          send_lv.phone = phone.text;

           

          send_lv.send("process.php", receive_lv, "POST");

           

          gotoAndStop("certificate");
          };

           


          1 person found this helpful
          • 2. Re: Help with code to send to PHP script
            Baal Bebb Level 1

            Thanks I tried that but I get an error when I compile. I'm using AS2 and it tells me:

             


            Type mismatch.

            Source:

             

            send_lv.send("process.php", receive_lv, "POST");

            • 3. Re: Help with code to send to PHP script
              Baal Bebb Level 1

              Nevermind, I got it work using sendAndLoad() instead of simply send().

               

              I have another issue though- for some reason it's not sending the data to the database in Firefox although it works in IE. Any thoughts on that?

               

              thanks again kglad.