# Movie clip onRollOver function call? newbie question!

**URL:** <https://forum.kirupa.com/t/movie-clip-onrollover-function-call-newbie-question/233408>\
**Category:** Uncategorized\
**Created:** [July 23, 2007, 7:11pm UTC](https://forum.kirupa.com/t/movie-clip-onrollover-function-call-newbie-question/233408 "2007-07-23T19:11:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![atarijake](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@atarijake](https://forum.kirupa.com/u/atarijake)\
**Post date:** [July 23, 2007, 7:11pm UTC](https://forum.kirupa.com/t/movie-clip-onrollover-function-call-newbie-question/233408/1 "2007-07-23T19:11:20Z")

</div>

I’m having an issue with a simple movieclip onRollOver event. Here’s my code:

```auto

_root.mc_shutternav.mc_nav_8.onRollOver = over;
_root.mc_shutternav.mc_nav_8.onRollOut = out;
_root.mc_shutternav.mc_nav_8.onRelease = hit;

// definition for over state    
function over() 
    {
    this.gotoAndPlay(2);
    }
    
// definition for out state
function out()
    {
    this.gotoAndPlay(6);
    }
    
function hit()
    {
    _root.gotoAndPlay(2,1); // play scene 2
    }

```

So all I’m trying to do is call one function to control my movie clip onRollOver actions, however I’d like to be able to pass variables to the “hit” function so something like this:

```auto

_root.mc_shutterright.mc_nav_8.onRelease = hit(variable);

function hit(variable) 
    {
    _global.urljumpto = variable; 
    trace(urljumpto);
    _root.gotoAndPlay(2,1); // play scene 2
    }

```

However, with this setup the function hit() is called automatically every time I publish the movie. What’s wrong with this? What’s the difference between mc.onRelease = function; and mc.onRelease = function()? thanks!!!

ps, sorry, I’m publishing in AS 2.0 and flash player 9
