Closing a pop up in Action Script 3

I’m having some problems closing the pop window[COLOR=Black].[/COLOR] If anyone know another way please let me know[URL=“”]..

Here is what i did in action script 2


exitbut.onPress = function(){

Here is what i’m trying in sction script 3

exit_but.addEventListener(MouseEvent.CLICK, closeWin);

function closeWin (e:MouseEvent):void {
navigateToURL(new URLRequest(“javascript:window.close()”), “_self”);

I’m looking for a better way .. this way seem buggEEE. If anyone can help I would be so grateful. Anna