# Rollover functions

**URL:** <https://forum.kirupa.com/t/rollover-functions/243135>\
**Category:** flash\
**Created:** [November 3, 2007, 5:34am UTC](https://forum.kirupa.com/t/rollover-functions/243135 "2007-11-03T05:34:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![moodie](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/moodie/32/1905_2.png) [@moodie](https://forum.kirupa.com/u/moodie)\
**Post date:** [November 3, 2007, 5:34am UTC](https://forum.kirupa.com/t/rollover-functions/243135/1 "2007-11-03T05:34:21Z")

</div>

Hi, I’ve been trying to sort this for hours, but just can’t figure out what I’m doing wrong … I’m trying to write a function that attaches a mc with info to the mc i’m rolling over. So bookText\_mc would be attached to book\_mc, phoneText\_mc to phone\_mc etc … I’ve got this so far:

```auto
function infoTextOver(info_mc:MovieClip) {
    this.onEnterFrame = function() {
        _root.attachMovie("info_mc","info_mc",this.getNextHighestDepth());
        info_mc._alpha += (100-info_mc._alpha)/4;
        info_mc._x = _xmouse;
        info_mc._y = _ymouse;
    };
};

function infoTextOut(info_mc:MovieClip) {
    this.onEnterFrame = function() {
        info_mc._alpha += (0-info_mc._alpha)/4;
        if (info_mc._alpha == 0) {
            info_mc("infoMovieClip");
        }
    };
};

button_mc.onRollOver = infoTextOver(buttonText_mc);
button_mc.onRollOut = infoTextOut(buttonText_mc);

```

I know its something to do with the parameter of the function but not sure what … any help would be awesome.  
Aaron
