# Creating a menu with all code on one frame

**URL:** <https://forum.kirupa.com/t/creating-a-menu-with-all-code-on-one-frame/196079>\
**Category:** flash\
**Created:** [August 5, 2006, 5:30am UTC](https://forum.kirupa.com/t/creating-a-menu-with-all-code-on-one-frame/196079 "2006-08-05T05:30:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iLikePie](https://avatars.discourse-cdn.com/v4/letter/i/85f322/32.png) [@iLikePie](https://forum.kirupa.com/u/iLikePie)\
**Post date:** [August 5, 2006, 5:30am UTC](https://forum.kirupa.com/t/creating-a-menu-with-all-code-on-one-frame/196079/1 "2006-08-05T05:30:43Z")

</div>

hey all,

i’m just getting used to the idea of doing most of my coding in a frame rather than attaching it all to clips, and i’m not sure of whether i can do that for a menu.

i’ve got 4 buttons that take the user to different frames (labelled) in the root timeline. Now normallly i’d just put a piece of code on each button and change the frame it goes to, easy.

but as i’m trying to learn the best, most developer-friendly way to do things, i’m just wondering if there’s some way to do it… i realise i could call the buttons from the root, i.e :

```auto
menu.button1.onRelease=function(){

```

but i can’t really see an advantage to doing that for each button rather than just putting the code on the buttons within the menu clip anyway.

any tips? i realise that there are personal ways people do things, but as i said i’m just trying to learn as much as i can 🙂

thanks  
Stu
