# I stink at AS -- button trouble

**URL:** <https://forum.kirupa.com/t/i-stink-at-as-button-trouble/264875>\
**Category:** Uncategorized\
**Created:** [July 1, 2008, 3:14pm UTC](https://forum.kirupa.com/t/i-stink-at-as-button-trouble/264875 "2008-07-01T15:14:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jynx](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@jynx](https://forum.kirupa.com/u/jynx)\
**Post date:** [July 1, 2008, 3:14pm UTC](https://forum.kirupa.com/t/i-stink-at-as-button-trouble/264875/1 "2008-07-01T15:14:54Z")

</div>

ok so im using Flash CS3 with AS2, and I cant get a button to work for me. I want the button to send me to a url on release and also gotoAndPlay scene 2 frame 1. I have the syntax down, but its just not working, would anyone be able to look at it for me? I know its something really simple that needs to be done to fix it, but I cant figureit out.

---

<div class="post-metadata">

**Author:** ![dru\_nasty](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@dru\_nasty](https://forum.kirupa.com/u/dru_nasty)\
**Post date:** [July 1, 2008, 4:08pm UTC](https://forum.kirupa.com/t/i-stink-at-as-button-trouble/264875/2 "2008-07-01T16:08:01Z")

</div>

```auto
on(release){
getURL("urlhere");
gotoAndPlay("frameLabelHere");
}

```

---

<div class="post-metadata">

**Author:** ![jynx](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@jynx](https://forum.kirupa.com/u/jynx)\
**Post date:** [July 1, 2008, 4:33pm UTC](https://forum.kirupa.com/t/i-stink-at-as-button-trouble/264875/3 "2008-07-01T16:33:31Z")

</div>

[quote=dru\_nasty;2351938] ActionScript Code:  
[LEFT][COLOR=#0000FF]on[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]  
[COLOR=#0000FF]getURL[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#0000FF]gotoAndPlay[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[/LEFT]

[/quote]

i tried using that, but i dont think i put it in the right spot. it said it can only be used on button instance.

---

<div class="post-metadata">

**Author:** ![jynx](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@jynx](https://forum.kirupa.com/u/jynx)\
**Post date:** [July 1, 2008, 5:28pm UTC](https://forum.kirupa.com/t/i-stink-at-as-button-trouble/264875/4 "2008-07-01T17:28:57Z")

</div>

> [@jynx;2351958](#):
>
> i tried using that, but i dont think i put it in the right spot. it said it can only be used on button instance.

i put that on the first frame of the button instance and it doesnt do anything. i also put it on an actions layer as my\_button.onRelease funtion()

and that didnt work either

---

<div class="post-metadata">

**Author:** ![dru\_nasty](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@dru\_nasty](https://forum.kirupa.com/u/dru_nasty)\
**Post date:** [July 1, 2008, 5:32pm UTC](https://forum.kirupa.com/t/i-stink-at-as-button-trouble/264875/5 "2008-07-01T17:32:51Z")

</div>

post your fla please

---

<div class="post-metadata">

**Author:** ![jynx](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@jynx](https://forum.kirupa.com/u/jynx)\
**Post date:** [July 1, 2008, 6:27pm UTC](https://forum.kirupa.com/t/i-stink-at-as-button-trouble/264875/6 "2008-07-01T18:27:04Z")

</div>

ok so basically what i want this to look like: [http://www.waldenmed.com/](http://www.waldenmed.com/)

and what i have so far: [link](http://babakspage.com/final.fla)  
should work if you right click save as

---

<div class="post-metadata">

**Author:** ![dru\_nasty](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@dru\_nasty](https://forum.kirupa.com/u/dru_nasty)\
**Post date:** [July 1, 2008, 7:19pm UTC](https://forum.kirupa.com/t/i-stink-at-as-button-trouble/264875/7 "2008-07-01T19:19:57Z")

</div>

All you need to do is give your button an instance name “pureple\_butt” (no quotes).

On another note, it’d be cool to just put the getURL function on the last from of your Scene2. That way the outro animation plays, then the swf loads the url. Just an idea 😉

---

<div class="post-metadata">

**Author:** ![jynx](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@jynx](https://forum.kirupa.com/u/jynx)\
**Post date:** [July 1, 2008, 7:33pm UTC](https://forum.kirupa.com/t/i-stink-at-as-button-trouble/264875/8 "2008-07-01T19:33:34Z")

</div>

WOW! It worked, thanks so much!!

---

<div class="post-metadata">

**Author:** ![dru\_nasty](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@dru\_nasty](https://forum.kirupa.com/u/dru_nasty)\
**Post date:** [July 1, 2008, 7:40pm UTC](https://forum.kirupa.com/t/i-stink-at-as-button-trouble/264875/9 "2008-07-01T19:40:13Z")

</div>

no problem
