# Button class?

**URL:** <https://forum.kirupa.com/t/button-class/194399>\
**Category:** Uncategorized\
**Created:** [July 22, 2006, 10:29pm UTC](https://forum.kirupa.com/t/button-class/194399 "2006-07-22T22:29:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JCPalmer](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@JCPalmer](https://forum.kirupa.com/u/JCPalmer)\
**Post date:** [July 22, 2006, 10:29pm UTC](https://forum.kirupa.com/t/button-class/194399/1 "2006-07-22T22:29:00Z")

</div>

so I am making a menu and I stumble across the notion of making a class to define these buttons instead of the following:

```auto

b1.onRollOver = over;
b1.onRollOut = out;
b1.b1_button_text.b1_text.text = "HOME";

b2.onRollOver = over;
b2.onRollOut = out;
b2.b1_button_text.b1_text.text = "PORTFOLIO";

b3.onRollOver = over;
b3.onRollOut = out;
b3.b1_button_text.b1_text.text = "RESUME";

b4.onRollOver = over;
b4.onRollOut = out;
b4.b1_button_text.b1_text.text = "CONTACT";

function over() {
	this.gotoAndPlay('b1_rollover');
}

function out() {
	this.gotoAndPlay('b1_rollout');
}

```

any idea how I do that?
