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
You'll need to use some JavaScript / Jquery to capture the unload event of the browser and call your function in Flash. Check out this article:
http://eureka.ykyuen.info/2011/02/22/jquery-javascript-capture-the-browser-or-tab-closed-e vent/