# Simple question about functions

**URL:** <https://forum.kirupa.com/t/simple-question-about-functions/188619>\
**Category:** Uncategorized\
**Created:** [May 9, 2006, 2:15pm UTC](https://forum.kirupa.com/t/simple-question-about-functions/188619 "2006-05-09T14:15:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scarlac](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@scarlac](https://forum.kirupa.com/u/scarlac)\
**Post date:** [May 9, 2006, 2:15pm UTC](https://forum.kirupa.com/t/simple-question-about-functions/188619/1 "2006-05-09T14:15:59Z")

</div>

Hi there

I have a simple question about functions.  
I have a few scripts for my buttons, each button has its own script. I have also a script for colormodifications, But I do not want to copy that complete script in each button.

Here is a simplified version of the scripts for my buttons

```auto
but_bedrijf.onPress = function() {
	gotoAndStop("mainmenu");
}

but_sectionalep.onPress = function() {
	gotoAndStop("sectionalep");
}

but_buitenp.onPress = function() {
	gotoAndStop("buitenp");
}

but_pauto.onPress = function() {
	gotoAndStop("pauto");
}

```

Here is the function I’d like to be called in every script.

```auto
blueColor = function() {
	var my_color:Color = new Color(this);
	my_color.setRGB(0x46AAC2);
}

```

I would like that the button changes of color when I Pressed on it.

I know I should type in every script this code  
blueColor();

But my complete set of buttons changes to blue, Isn’t there something we have to put between those ().

Thanx in advance
