# Multiple movieclips fading and unfading

**URL:** <https://forum.kirupa.com/t/multiple-movieclips-fading-and-unfading/82589>\
**Category:** Uncategorized\
**Created:** [March 11, 2005, 1:46pm UTC](https://forum.kirupa.com/t/multiple-movieclips-fading-and-unfading/82589 "2005-03-11T13:46:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sammo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sammo/32/779_2.png) [@Sammo](https://forum.kirupa.com/u/Sammo)\
**Post date:** [March 11, 2005, 1:46pm UTC](https://forum.kirupa.com/t/multiple-movieclips-fading-and-unfading/82589/1 "2005-03-11T13:46:28Z")

</div>

Hey, I have 36 instances of one movieclip (called panel1, panel2…panel36) that I want to fade and unfade depending on whether the mouse has rolled over that one instance, I tried this code, which works when there is only one instance, but not when multiple.

```auto
_root.onEnterFrame = function () {
    for (i = 0; i < 36; i++) {
        name = "panel"+i;
        if (rollover) {
            if (_root[name]._alpha > 0) {
                _root[name]._alpha -= 10;    
            }
        }
        if (rollout) {
            if (_root[name]._alpha < 100) {
                _root[name]._alpha +=10;
            }
        }
    }
    _root[name].onRollOver = function () {
        rollover = true;
        rollout = false;
    }
    _root[name].onRollOut = function () {
        rollout = true;
        rollover = false;
    }
}

```

Does anyone have any ideas on why it isn’t working and how to make it work?

Thanks in advance, Sammo 🙂  
[url=“[http://cannedlaughter.net/rollover+out.fla](http://cannedlaughter.net/rollover+out.fla)”]  
rollover+out.fla (MX)
