# Flash 8 ActionScript version 2.0. Button redirecting

**URL:** https://forum.kirupa.com/t/flash-8-actionscript-version-2-0-button-redirecting/184793
**Category:** Uncategorized
**Created:** [April 7, 2006, 8:57pm UTC](https://forum.kirupa.com/t/flash-8-actionscript-version-2-0-button-redirecting/184793 "2006-04-07T20:57:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![toxicmage](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@toxicmage](https://forum.kirupa.com/u/toxicmage)
#### Post date: [April 7, 2006, 8:57pm UTC](https://forum.kirupa.com/t/flash-8-actionscript-version-2-0-button-redirecting/184793/1 "2006-04-07T20:57:35Z")

</div>

So im building this flash website for college. It was ment to be in HTML, but i thought i would be a little different and try something in Flash.  
Although the action scrpit is getting me down. (i use C++ as my main code language, so this is all kind of new to me!)

I am aiming to click the buttons to take you through parts of the site and load it in one set graphic window. Changing the text each time a different button is pressed.

I can work out part of my code which is:

\*\*onPress = function () {  
gotoAndPlay(“SceneX”, _1_);  
};

\*\*But this brings up one nasty error that says:

\*\*must appear within on handler  
\*\*I have browsed through the AS help file, but cant make much of it.  
some help on this small fix would be very nice 😉 Thanks

---

<div class="post-metadata">

### Author: ![gvozden](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/gvozden/32/1084_2.png) [@gvozden](https://forum.kirupa.com/u/gvozden)
#### Post date: [April 7, 2006, 11:41pm UTC](https://forum.kirupa.com/t/flash-8-actionscript-version-2-0-button-redirecting/184793/2 "2006-04-07T23:41:29Z")

</div>

onPress must appear with movieclip instance name you are want to tell what to do on press

like mc\_open you write

mc\_open.onPress

---

<div class="post-metadata">

### Author: ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)
#### Post date: [April 8, 2006, 1:45am UTC](https://forum.kirupa.com/t/flash-8-actionscript-version-2-0-button-redirecting/184793/3 "2006-04-08T01:45:28Z")

</div>

I’m guessing that you have the ActionScript on the button itself, so use this:

```auto
on (press) {
	gotoAndPlay("SceneX", 1);
}

```

---

<div class="post-metadata">

### Author: ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)
#### Post date: [April 8, 2006, 4:58am UTC](https://forum.kirupa.com/t/flash-8-actionscript-version-2-0-button-redirecting/184793/4 "2006-04-08T04:58:48Z")

</div>

> [@Krilnon](#):
>
> I’m guessing that you have the ActionScript on the button itself, so use this:

Except: [http://www.senocular.com/flash/tutorials/faq/#gotoscene](http://www.senocular.com/flash/tutorials/faq/#gotoscene) 🙂
