# Help with writing a function

**URL:** https://forum.kirupa.com/t/help-with-writing-a-function/195567
**Category:** flash
**Created:** [August 1, 2006, 5:08pm UTC](https://forum.kirupa.com/t/help-with-writing-a-function/195567 "2006-08-01T17:08:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mikedkap](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@mikedkap](https://forum.kirupa.com/u/mikedkap)
#### Post date: [August 1, 2006, 5:08pm UTC](https://forum.kirupa.com/t/help-with-writing-a-function/195567/1 "2006-08-01T17:08:39Z")

</div>

I want to make these 7 events into one function that I can put on a few different buttons’ onPress function so that I don’t need to have those seven lines of code on every button, just one line instead:

```auto

    tour_mc.unloadMovie();
    logo_mc.tour_subnav.north_nav.enabled = true;
    logo_mc.tour_subnav.south_nav.enabled = true;
    logo_mc.tour_subnav.victorian_nav.enabled = true;
    my_colornorth.setRGB(0x666666);
    my_colorsouth.setRGB(0x666666);
    my_colorvic.setRGB(0x666666);

```

Can somebody help me with the syntax? Thanks!
