# \[MX2004\] Functions

**URL:** <https://forum.kirupa.com/t/mx2004-functions/140106>\
**Category:** Uncategorized\
**Created:** [March 8, 2005, 1:35pm UTC](https://forum.kirupa.com/t/mx2004-functions/140106 "2005-03-08T13:35:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kBisk](https://avatars.discourse-cdn.com/v4/letter/k/eb8c5e/32.png) [@kBisk](https://forum.kirupa.com/u/kBisk)\
**Post date:** [March 8, 2005, 1:35pm UTC](https://forum.kirupa.com/t/mx2004-functions/140106/1 "2005-03-08T13:35:41Z")

</div>

I have a function that I want called when different mc’s are rolled over.

**img\_hover = function (n){  
\_root.icap = \_root.i+(eval(n))+\_caption;  
\_root.idate = \_root.i+(eval(n))+\_date;  
\_root.isource = \_root.i+(eval(n))+\_source;  
\_root.isourcetxt = “Source:”;  
\_root.inum = \_root.i+(eval(n))+".";  
}**

The “n” is an interger (ex. 1-200) that I need passed to this function with the rollover of an mc:

**on (rollOver) {  
\_root.img\_hover.apply(‘1’);  
}**

I can’t get this to work. I’m not sure of the proper way to pass the n value to the function in the img\_hover.apply() code.

The function should produce the following (ex. with n=23):

**img\_hover = function (n){  
\_root.icap = \_root.i23\_caption;  
\_root.idate = \_root.i23\_date;  
\_root.isource = \_root.i23\_source;  
\_root.isourcetxt = “Source:”;  
\_root.inum = \_root.i23+".";  
}**
