# Dinamic functions help

**URL:** <https://forum.kirupa.com/t/dinamic-functions-help/213935>\
**Category:** Uncategorized\
**Created:** [January 24, 2007, 12:04pm UTC](https://forum.kirupa.com/t/dinamic-functions-help/213935 "2007-01-24T12:04:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sirupa](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sirupa](https://forum.kirupa.com/u/sirupa)\
**Post date:** [January 24, 2007, 12:04pm UTC](https://forum.kirupa.com/t/dinamic-functions-help/213935/1 "2007-01-24T12:04:20Z")

</div>

hi all,  
I’m writing function for hoover efect in dinamic xml menu.  
Function is working, but I got to shorten my code.

function hoover(){  
\_root.menu0.onRollOver = function () {  
this.\_alpha = 50;  
};  
\_root.menu1.onRollOver = function () {  
this.\_alpha = 50;  
};  
…  
}

I have number of menus in variable nMenu.  
How can I do this? Thanx.
