# Calling a function with a argument in the ContextMenuItem class, how?

**URL:** <https://forum.kirupa.com/t/calling-a-function-with-a-argument-in-the-contextmenuitem-class-how/176255>\
**Category:** Uncategorized\
**Created:** [January 22, 2006, 1:49am UTC](https://forum.kirupa.com/t/calling-a-function-with-a-argument-in-the-contextmenuitem-class-how/176255 "2006-01-22T01:49:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morix](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@Morix](https://forum.kirupa.com/u/Morix)\
**Post date:** [January 22, 2006, 1:49am UTC](https://forum.kirupa.com/t/calling-a-function-with-a-argument-in-the-contextmenuitem-class-how/176255/1 "2006-01-22T01:49:39Z")

</div>

hi,  
im tryng to call a function with a argument in the ContextMenuItem class.

code:

```auto

function down(id){
    txt.text = id;
    //trace(id);
};
var my_cm = new ContextMenu();
menuItem_cmi = Array();
for (i=1;i<6;i++){
    menuItem_cmi* = new ContextMenuItem("product: "+i, down(i));
    my_cm.customItems.push(menuItem_cmi*);
}
my_cm.hideBuiltInItems();
cart.menu = my_cm;

```

It seems that when ever I try to send an argument with the down function, it simpley dont work and without it, it does work
