8 Replies Latest reply on Jun 1, 2007 2:25 PM by mathyoo

    form submission thrugh flash

    mathyoo
      I have a form with this code:

      form id='mailinglist_form' method="post" action=" http://url.com/index.php" >
      <div>
      <input type="hidden" name="XID" value="2d23601ce3401a2c2c643a5e9f66b26318ef07d9" />
      <input type="hidden" name="ACT" value="3" />
      <input type="hidden" name="RET" value=" http://url.com/index.php/site/mailing_list/" />
      <input type="hidden" name="list" value="default" />
      </div>



      <p>Join our Mailing List</p>

      <p><input type="text" name="email" value="" /></p>

      <p><input type="submit" value="submit" /></p>

      </form>

      that I'd like to submit to from within Flash. I've been told (on another forum) that this actionscript is what I need:

      var sendVars:LoadVars = new LoadVars();
      sendVars.XID = "2d23601ce3401a2c2c643a5e9f66b26318ef07d9";
      sendVars.ACT = "3";
      sendVars.RET = " http://url.com/index.php/site/mailing_list/";
      sendVars.list = "default";
      sendVars.email = "theEmail@somedomain.com";

      sendVars.onLoad = function(success:Boolean):Void
      {
      if(success)
      {
      //the call was successful
      }
      else
      {
      //there was an error
      }
      };

      sendVars.sendAndLoad(" http://url.com/index.php", sendVars, "post");


      However, I'm not sure where to put that actionscript. Does it go on the "submit" button? the main timeline?