# Making Life Easier assigning on Script for 10 Buttons

**URL:** <https://forum.kirupa.com/t/making-life-easier-assigning-on-script-for-10-buttons/216200>\
**Category:** flash\
**Created:** [February 14, 2007, 2:07pm UTC](https://forum.kirupa.com/t/making-life-easier-assigning-on-script-for-10-buttons/216200 "2007-02-14T14:07:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChromeDemon](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@ChromeDemon](https://forum.kirupa.com/u/ChromeDemon)\
**Post date:** [February 14, 2007, 2:07pm UTC](https://forum.kirupa.com/t/making-life-easier-assigning-on-script-for-10-buttons/216200/1 "2007-02-14T14:07:25Z")

</div>

I have 10 Buttons

on each Button is this

```auto

if (s == _level0.itemX.icon) {
                    trace(s);
                    v1.onRollOver = function () {
                    this.gotoAndPlay(2);
                    }
                    v1.onRollOut = function () {
                    this.gotoAndPlay(7);
                    }
                    v1.onRelease = function () {
                    _root.vote10 = 1;
                    }
                    v2.onRollOver = function () {
                    this.gotoAndPlay(2);
                    }
                    v2.onRollOut = function () {
                    this.gotoAndPlay(7);
                    }
                    v2.onRelease = function () {
                    _root.vote10 = 2;
                    }
}

```

the thing which differs is \_root.vote (which is from 1-10) and the (s == \_level0.item9.icon) which is from 1 to 10 too …

is there a way to make this easier, coz when i have to change sumthing i have stroll through all the buttons and change it …

thanx in advance

ChromeD
