# \*Want to close the present window before going to the url page

**URL:** <https://forum.kirupa.com/t/want-to-close-the-present-window-before-going-to-the-url-page/322755>\
**Category:** Uncategorized\
**Created:** [June 2, 2011, 1:33am UTC](https://forum.kirupa.com/t/want-to-close-the-present-window-before-going-to-the-url-page/322755 "2011-06-02T01:33:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tseyigai](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@tseyigai](https://forum.kirupa.com/u/tseyigai)\
**Post date:** [June 2, 2011, 1:33am UTC](https://forum.kirupa.com/t/want-to-close-the-present-window-before-going-to-the-url-page/322755/1 "2011-06-02T01:33:09Z")

</div>

Hi,  
I’m using the script below to go to url function in actionscript 3, and it works fine:

[COLOR=red]btn.addEventListener(MouseEvent.CLICK,e);

function e(e:MouseEvent):void{  
navigateToURL(new URLRequest(“[http://www.angelfire.com/in/HisTruth/copyofindex.html](http://www.angelfire.com/in/HisTruth/copyofindex.html)”));  
}[/COLOR]

[COLOR=blue]It’s fine but I want the first window to close and then open up into the one its pointing to.[/COLOR]  
How should I add the correct script to this?

Tseyigai
