NativeApplication is used for AIR app.
use this instead:
<?xml version="1.0" encoding="utf-8"?>
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
private var browserType:String = "";
private var urlString:String;
private var request:URLRequest;
private function closeWindow():void
* For this to work in Firefox,
* Type in "about:config" in firefox address bar
* set dom.allow_scripts_to_close_windows to true.
request = new URLRequest(urlString);
<mx:Button label="Close Window" id="closeBtn" click="closeWindow()"/>
Thank you for your response.Actually i already tried that option but the problem is, it shows a confirmation message before closing the browser and i dont want that.Any idea how we can supress it?
Nope, that is a browser security feature. There are many things you just can't do from a browser, which is why AIR is available.
I stumbled on this thread looking for a way to remove the confirmation popup. I was told that if we could reference the name of the window, we could close it without the popup. Any ideas on how to do this?
window.opener = null;
call this function through ExternalInterface.call('ExitApp'); in you flex application (worked for me in IE6 does not give you a popup confirmation not sure about later version of browsers)