# Linking Buttons To External URLS

**URL:** <https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589>\
**Category:** flash\
**Created:** [February 2, 2003, 6:10am UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589 "2003-02-02T06:10:57Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ndevore007](https://avatars.discourse-cdn.com/v4/letter/n/e19adc/32.png) [@ndevore007](https://forum.kirupa.com/u/ndevore007)\
**Post date:** [February 2, 2003, 6:10am UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589/1 "2003-02-02T06:10:57Z")

</div>

I have several buttons in my project that I want to link to Outside Webpages, what is the the action script to do so?

Example:  
When Buttonx is clicked on [http://www.x.com](http://www.x.com) opens in a new window.

Thanks in Advance for an replies

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 2, 2003, 6:48am UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589/2 "2003-02-02T06:48:12Z")

</div>

here’s how I do it:

```php
on (release) {
	getURL("http://www.somesite.com/", "_blank");
}

```

Simply add that to the main properties of the button from the  
stage. Hope it helps!

/unflux  
:goatee:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 2, 2003, 6:48am UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589/3 "2003-02-02T06:48:33Z")

</div>

on(release){  
getURL(“yourURL”,"\_blank");  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 2, 2003, 7:54am UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589/4 "2003-02-02T07:54:57Z")

</div>

I noticed you redirected your site to paypal. Are you redirecting it to there? If so there is a nice easy to use extension for flash here:

[http://www.webassist.com/Products/ProductDetails.asp?PID=24&RID=82](http://www.webassist.com/Products/ProductDetails.asp?PID=24&RID=82)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 2, 2003, 4:54pm UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589/5 "2003-02-02T16:54:15Z")

</div>

I was using that code before and it is not working, Am I doing something wrong in implementing the code? I put the Action Script in the last static keyframe it looks like this

> on (release) {

> getURL(“[www.google.com](http://www.google.com)”, “\_blank”);

I can’t uderstand why it won’t work, also there is a syntax error which arises

> Mouse events are permitted only for button instances

I think this probably has something to do with it but it doesn’t make sense becasue the button I’m using is as far as I know a button type.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 2, 2003, 6:29pm UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589/6 "2003-02-02T18:29:55Z")

</div>

Don’t use www but put http:// in front of your url.

Is that what was wrong?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 2, 2003, 6:31pm UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589/7 "2003-02-02T18:31:06Z")

</div>

1)Wow, I didn’t even notice unflux posted at the same time as me.

1. Well if you use on(release) that is a button handler and therefore must be used on a button symbol(and can also be used on a movie clip symbol in Flash MX). If you want it to launch when a frame is reached just use the getURL part and forget about the on handler.

And yes… using http:// in front of www is recommended.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 2, 2003, 7:02pm UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589/8 "2003-02-02T19:02:24Z")

</div>

I still do this sometimes when making a button. Did you insert all 4 frames to your button. Standard flash buttons I think have over, up, down and relase. If there is not instance for the release the button will not work.

Is that what was wrong?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 2, 2003, 7:04pm UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589/9 "2003-02-02T19:04:00Z")

</div>

You don’t need to have all frames filled.

I have done buttons with only the over frame filled and my buttons work fine. As long as your symbol is there, you are fine.

The error says that he cannot use the code because on handlers are for buttons.

He is using the code on a frame. And if that is what he wants to do then he must remove the on handler and just use the getURL.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 2, 2003, 7:10pm UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589/10 "2003-02-02T19:10:29Z")

</div>

Cool thanks.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 2, 2003, 7:11pm UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589/11 "2003-02-02T19:11:28Z")

</div>

No problem 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 2, 2003, 7:37pm UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589/12 "2003-02-02T19:37:36Z")

</div>

I finally figured it out! I had converted the button to a symbol on accident so it wasn’tt working. I must not have been thinking clearly at 2AM last night.

Thanks for all your help.

-Nate

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 2, 2003, 7:40pm UTC](https://forum.kirupa.com/t/linking-buttons-to-external-urls/12589/13 "2003-02-02T19:40:39Z")

</div>

Yeah, 2am sometimes does that to people 😉

I know :beam:

Keep in mind in the future you can also use on handlers on movie clip symbols if you are using MX and exporting your file as an MX file.

This comes in handy for more “advanced” buttons if you know what your doing.

I recommend you get used to using both. Just because there is another method doesn’t mean you should get used to using only one 😉
