1 Reply Latest reply: Sep 17, 2012 4:59 AM by dmeN RSS

    save data before close browser

    rahimhaji Community Member

      Dear Friends,

       

      iam loading my swf file in aspx file on the browser, when i click a button i will pass 2 variables to database and close or unload. If the user close the browser withtout click on that button i want to post that values and save in the dtabase. how can i do that pls explain me.

       

      find below the code i used to store data when i click a button.

       

       

      var variables:URLVariables = new URLVariables();

      var varSend:URLRequest = new URLRequest("lmsHome.aspx");

      var varLoader:URLLoader = new URLLoader;

      varSend.method = URLRequestMethod.POST;

      varSend.data = variables;

       

      frdbut.addEventListener(MouseEvent.CLICK,sendMessage);

       

      function sendMessage(event:MouseEvent):void {

          variables.elecode = lescode;

          variables.eleduration = "2:0"

          varLoader.load(varSend);

      }

       

       

      Thanks in advance,

      Syed Abdul Rahim