# Help me simplify this AS!

**URL:** <https://forum.kirupa.com/t/help-me-simplify-this-as/182274>\
**Category:** flash\
**Created:** [March 16, 2006, 8:00pm UTC](https://forum.kirupa.com/t/help-me-simplify-this-as/182274 "2006-03-16T20:00:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ginsengdesign](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@ginsengdesign](https://forum.kirupa.com/u/ginsengdesign)\
**Post date:** [March 16, 2006, 8:00pm UTC](https://forum.kirupa.com/t/help-me-simplify-this-as/182274/1 "2006-03-16T20:00:33Z")

</div>

```auto
lunchMenu.lunch1.onRollOver = function() { 
    lunchMenu.lunch1.gotoAndStop("on");
    lunchMenu.lunch1.dishContents.text = "Dish Contents";
}
lunchMenu.lunch1.onRollOut = function() { 
    lunchMenu.lunch1.gotoAndStop("off");
}
lunchMenu.lunch2.onRollOver = function() { 
    lunchMenu.lunch2.gotoAndStop("on");
    lunchMenu.lunch2.dishContents.text = "Dish Contents";
}
lunchMenu.lunch2.onRollOut = function() { 
    lunchMenu.lunch2.gotoAndStop("off");
}
lunchMenu.lunch3.onRollOver = function() { 
    lunchMenu.lunch3.gotoAndStop("on");
    lunchMenu.lunch3.dishContents.text = "Dish Contents";
}
lunchMenu.lunch3.onRollOut = function() { 
    lunchMenu.lunch3.gotoAndStop("off");
}
lunchMenu.lunch4.onRollOver = function() { 
    lunchMenu.lunch4.gotoAndStop("on");
    lunchMenu.lunch4.dishContents.text = "Dish Contents";
}
lunchMenu.lunch4.onRollOut = function() { 
    lunchMenu.lunch4.gotoAndStop("off");
}
lunchMenu.lunch5.onRollOver = function() { 
    lunchMenu.lunch5.gotoAndStop("on");
    lunchMenu.lunch5.dishContents.text = "Dish Contents";
}
lunchMenu.lunch5.onRollOut = function() { 
    lunchMenu.lunch5.gotoAndStop("off");
}
lunchMenu.lunch6.onRollOver = function() { 
    lunchMenu.lunch6.gotoAndStop("on");
    lunchMenu.lunch6.dishContents.text = "Dish Contents";
}
lunchMenu.lunch6.onRollOut = function() { 
    lunchMenu.lunch6.gotoAndStop("off");
}

```

…and so on.

I know there’s a way to simplify this. I’ve got a lot of menus and a lot of menu items…

THANKS!

-t
