# Problems with linking button to URL inside movie clip

**URL:** https://forum.kirupa.com/t/problems-with-linking-button-to-url-inside-movie-clip/328299
**Category:** flash
**Created:** [May 5, 2012, 11:50pm UTC](https://forum.kirupa.com/t/problems-with-linking-button-to-url-inside-movie-clip/328299 "2012-05-05T23:50:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ourkid](https://avatars.discourse-cdn.com/v4/letter/o/50afbb/32.png) [@ourkid](https://forum.kirupa.com/u/ourkid)
#### Post date: [May 5, 2012, 11:50pm UTC](https://forum.kirupa.com/t/problems-with-linking-button-to-url-inside-movie-clip/328299/1 "2012-05-05T23:50:46Z")

</div>

Hi guys, I’m having some problems trying to get a button to link to a URL from within a tweening movie clip on the main timeline. Basically I am tweening scrolling credits and wish for each credit to link to a URL when clicked. I’ve used this code inside the movie clip for each button:

```auto
btnLocust.addEventListener(MouseEvent.CLICK, locustFunction);

function locustFunction(evt:MouseEvent):void {
    navigateToURL(new URLRequest("http://www.fat-pie.com/locust/"), "_blank");
}

```

This code didn’t work, so I tried the following on the main timeline:

```auto
creds.btnLocust.addEventListener(MouseEvent.CLICK, locustFunction);

function locustFunction(evt:MouseEvent):void {
    navigateToURL(new URLRequest("http://www.fat-pie.com/locust/"), "_blank");
}

```

“creds” being the instance name for the movie clip. This didn’t work either and it’s left me clueless as I’m a total amateur at actionscript 3. Anyways, I hope you can steer me in the right direction 🙂

Thanks in advance!
