# Is there an easier way?

**URL:** <https://forum.kirupa.com/t/is-there-an-easier-way/195499>\
**Category:** Uncategorized\
**Created:** [August 1, 2006, 5:31am UTC](https://forum.kirupa.com/t/is-there-an-easier-way/195499 "2006-08-01T05:31:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![watery\_fart](https://avatars.discourse-cdn.com/v4/letter/w/ba8739/32.png) [@watery\_fart](https://forum.kirupa.com/u/watery_fart)\
**Post date:** [August 1, 2006, 5:31am UTC](https://forum.kirupa.com/t/is-there-an-easier-way/195499/1 "2006-08-01T05:31:06Z")

</div>

i have a simple navigation panel and i noticed that they all pretty much have the same actionscript guiding them, but my actions frame looks like this:

```auto
a1.buttonText.buttonText.text = "HOME"
a1.onRollOver = function() {
 this.gotoAndPlay(2)
 kirupaSound = new Sound(this);
 kirupaSound.attachSound("blip");
 kirupaSound.start(0,0)
}
a1.onRollOut = function() {
 this.gotoAndPlay(6)
}
a2.buttonText.buttonText.text = "FORUMS"
a2.onRollOver = function() {
 this.gotoAndPlay(2)
 kirupaSound = new Sound(this);
 kirupaSound.attachSound("blip");
 kirupaSound.start(0,0)
}
a2.onRollOut = function() {
 this.gotoAndPlay(6)
}
a3.buttonText.buttonText.text = "CONTACT"
a3.onRollOver = function() {
 this.gotoAndPlay(2)
 kirupaSound = new Sound(this);
 kirupaSound.attachSound("blip");
 kirupaSound.start(0,0)
}
a3.onRollOut = function() {
 this.gotoAndPlay(6)
}
a4.buttonText.buttonText.text = "LINKS"
a4.onRollOver = function() {
 this.gotoAndPlay(2)
 kirupaSound = new Sound(this);
 kirupaSound.attachSound("blip");
 kirupaSound.start(0,0)
}
a4.onRollOut = function() {
 this.gotoAndPlay(6)
}
a5.buttonText.buttonText.text = "APPLY"
a5.onRollOver = function() {
 this.gotoAndPlay(2)
 kirupaSound = new Sound(this);
 kirupaSound.attachSound("blip");
 kirupaSound.start(0,0)
}
a5.onRollOut = function() {
 this.gotoAndPlay(6)
}
a6.buttonText.buttonText.text = "FAQ"
a6.onRollOver = function() {
 this.gotoAndPlay(2)
 kirupaSound = new Sound(this);
 kirupaSound.attachSound("blip");
 kirupaSound.start(0,0)
}
a6.onRollOut = function() {
 this.gotoAndPlay(6)
}

```

is there a way to consolidate this code so that it still effects all the buttons?
