# AS2 Button headaches!

**URL:** <https://forum.kirupa.com/t/as2-button-headaches/286466>\
**Category:** flash\
**Created:** [April 15, 2009, 9:05pm UTC](https://forum.kirupa.com/t/as2-button-headaches/286466 "2009-04-15T21:05:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BeerOclock](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@BeerOclock](https://forum.kirupa.com/u/BeerOclock)\
**Post date:** [April 15, 2009, 9:05pm UTC](https://forum.kirupa.com/t/as2-button-headaches/286466/1 "2009-04-15T21:05:48Z")

</div>

Im actually pretty experienced in AS3 but I’m a complete noob at AS2:

I have a button that opens a url like so:

```auto

buttonA.onPress = navToPageA;
function navToPageA() {
	getURL("http://www.urlA.com", "_blank");
}

```

Then it was decided that clicking anywhere BUT that button should also take you to a URL:

```auto

_root.onMouseDown = navToPageB;
function navToPageB() {
	getURL("http://www.urlB.com", "_blank");
}

```

The problem is, when someone clicks the button, it opens urlA AND urlB! The button should only open urlA and anywhere else should only open urlB.  
I have an idea what is happening because I have experience with AS3, but I can not seem to find a fix for this in AS2!
