# getURL on a Movieclip

**URL:** <https://forum.kirupa.com/t/geturl-on-a-movieclip/11352>\
**Category:** flash\
**Created:** [January 15, 2003, 11:08pm UTC](https://forum.kirupa.com/t/geturl-on-a-movieclip/11352 "2003-01-15T23:08:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoungeActx](https://avatars.discourse-cdn.com/v4/letter/l/71c47a/32.png) [@LoungeActx](https://forum.kirupa.com/u/LoungeActx)\
**Post date:** [January 15, 2003, 11:08pm UTC](https://forum.kirupa.com/t/geturl-on-a-movieclip/11352/1 "2003-01-15T23:08:10Z")

</div>

How do I use the getURL method to work on a movie clip…here is an .fla file for an example of the type of thing I want to happen…

I tried:

on (press) {  
getURL(blah blah [blah.com](http://blah.com));

}

But the movieclip wouldn’t play…

Here is an .fla from Ultrashock that has the same type of thing I have…if anyone could help me out it would be much appreciatted…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:** [January 15, 2003, 11:35pm UTC](https://forum.kirupa.com/t/geturl-on-a-movieclip/11352/2 "2003-01-15T23:35:03Z")

</div>

```auto
on (rollOver) {
//do this
}
on (rollOut) {
//do this
}
on (release){
getURL("yourFile.html","_self");
}

```

You can change \_self to \_blank to open in a new window.

---

<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:** [January 15, 2003, 11:56pm UTC](https://forum.kirupa.com/t/geturl-on-a-movieclip/11352/3 "2003-01-15T23:56:21Z")

</div>

can you show me using that .fla…because I based my code on that…and when i try to do it…every possible way I know…it doesn’t work…

---

<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:** [January 16, 2003, 12:36am UTC](https://forum.kirupa.com/t/geturl-on-a-movieclip/11352/4 "2003-01-16T00:36:16Z")

</div>

actually, i found a way…thanks for the tip!

---

<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:** [January 16, 2003, 1:59am UTC](https://forum.kirupa.com/t/geturl-on-a-movieclip/11352/5 "2003-01-16T01:59:26Z")

</div>

Glad you found a way 🙂

Even though I don’t see why my way didn’t work, works great for me :-\

---

<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:** [January 16, 2003, 2:18am UTC](https://forum.kirupa.com/t/geturl-on-a-movieclip/11352/6 "2003-01-16T02:18:38Z")

</div>

actually, i didn’t find a way…i did a little bit of what you said, because I couldn’t get your way to work either, and i did a little tinkering…and still couldn’t get it…when i did it your way it wouldn’t goto the URL yet, the animation and everything worked…

same thing happened after a scrapped it…and rebuilt it another way.

i’m almost ready to give up on something soooo simple!

---

<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:** [January 16, 2003, 2:36am UTC](https://forum.kirupa.com/t/geturl-on-a-movieclip/11352/7 "2003-01-16T02:36:27Z")

</div>

Well for one, that .fla you posted up top there… it is in slash syntax… which is Flash 4!

I just tested the code on my own movieclip as a button and I got the getURL to work fine. I am trying to whip up a quick .fla for you.

---

<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:** [January 16, 2003, 2:40am UTC](https://forum.kirupa.com/t/geturl-on-a-movieclip/11352/8 "2003-01-16T02:40:55Z")

</div>

Thanks! I’m still trying…I know it is old syntax…i’ve just started learning MX, I learned on Flash 4, and Flash 5.

---

<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:** [January 16, 2003, 2:48am UTC](https://forum.kirupa.com/t/geturl-on-a-movieclip/11352/9 "2003-01-16T02:48:31Z")

</div>

Ok, here is the attachment. Took like 3 seconds to do, so excuse the tackiness 😉

---

<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:** [January 16, 2003, 3:19am UTC](https://forum.kirupa.com/t/geturl-on-a-movieclip/11352/10 "2003-01-16T03:19:02Z")

</div>

Ok…i did that…how come this doesn’t work…

---

<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:** [January 16, 2003, 3:20am UTC](https://forum.kirupa.com/t/geturl-on-a-movieclip/11352/11 "2003-01-16T03:20:13Z")

</div>

well…it works outside of Flash…AHHH!! I hate programming…

---

<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:** [January 16, 2003, 3:26am UTC](https://forum.kirupa.com/t/geturl-on-a-movieclip/11352/12 "2003-01-16T03:26:33Z")

</div>

You have to have contents.html in the same directory as your flash file, otherwise it can’t open what it can’t find in Flash.

I just created a lame content.html in notepad and saved it in the same directory, and it works.

And you really sure use on(release) I find it to be better for links for some reason.
