# Contextual Menu - passing parameters issue

**URL:** <https://forum.kirupa.com/t/contextual-menu-passing-parameters-issue/196595>\
**Category:** flash\
**Created:** [August 9, 2006, 5:19pm UTC](https://forum.kirupa.com/t/contextual-menu-passing-parameters-issue/196595 "2006-08-09T17:19:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![graylensman](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@graylensman](https://forum.kirupa.com/u/graylensman)\
**Post date:** [August 9, 2006, 5:19pm UTC](https://forum.kirupa.com/t/contextual-menu-passing-parameters-issue/196595/1 "2006-08-09T17:19:27Z")

</div>

Okay, working on a right-click contextual menu to download jpegs. My particular issue is this: I’ve got the menu working properly, and I can create a new contextual menu item. The issue is this:

```
ActionScript Code:
[FONT=Courier New][LEFT]clickPic_cmi = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000FF]ContextMenuItem[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]"Save Picture"[/COLOR], savePeg[COLOR=#000000])[/COLOR];

```

pegMenu\_cm.[COLOR=#0000FF]customItems[/COLOR].[COLOR=#0000FF]push[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000] **function** [/COLOR] savePegCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#000000] **var** [/COLOR] downloadPeg:FileReference = [COLOR=#000000] **new** [/COLOR] FileReferenceCOLOR=#000000[/COLOR];  
downloadPeg.[COLOR=#000080]download[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“Deckard03.jpg”[/COLOR], [COLOR=#FF0000]“Deckard03.jpg”[/COLOR][COLOR=#000000])[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

Where in clickPic\_cmi the reference to savePeg is the function to be called. Now, this is where I’m having trouble- I want to be able to pass parameters through the function savePeg, instead of hard-coding specific references. But I can’t get it to work.

Any ideas?

Thanks to everyone who’s been helping me with this problem!
