# Control multiple movieclip rollovers

**URL:** https://forum.kirupa.com/t/control-multiple-movieclip-rollovers/178738
**Category:** Uncategorized
**Created:** [February 13, 2006, 9:36pm UTC](https://forum.kirupa.com/t/control-multiple-movieclip-rollovers/178738 "2006-02-13T21:36:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kingman109](https://avatars.discourse-cdn.com/v4/letter/k/b5ac83/32.png) [@kingman109](https://forum.kirupa.com/u/kingman109)
#### Post date: [February 13, 2006, 9:36pm UTC](https://forum.kirupa.com/t/control-multiple-movieclip-rollovers/178738/1 "2006-02-13T21:36:47Z")

</div>

okay, well this is my first post on the site so i’ll start it off with something easy things which is giving me some trouble.

- im creating an interactive piece which requires 100 movie clips to be created which im treating as buttons. Each of these movie clips need a rollover and rolloff command and also need to load an external jpg into a movie clip on press. (along with few other actions)

anyway… long and tedious way was i create all 100 and wrote code for each MC

```auto
_root.eh_2.onPress = function() {
	var BGalpha = _root.BG_mc1._alpha;
	_root.BG_mc1.loadMovie("../images/backgrounds/2.jpg");
	new Tween(_root.BG_mc1, "_alpha", Strong.easeOut, BGalpha, 100, 10, false);
};
_root.eh_2.onRollOver = function() {
	var EHalpha1 = _root.eh_2._alpha;
	new Tween(_root.eh_2, "_alpha", Strong.easeOut, EHalpha1, 50, 10, false);
};
_root.eh_2.onRollOut = function() {
	var EHalpha1 = _root.eh_2._alpha;
	new Tween(_root.eh_2, "_alpha", Strong.easeOut, EHalpha1, 10, 10, false);
};

```

knowing i needed to do something cleaner and allow me to change what happens easier… so im using duplicate movie to generate all 100 and name them ( eh\_1, eh\_2, eh\_3, etc…)

how could i write the rollovers to apply to all 100 buttons?
