var cm:ContextMenu=new ContextMenu(cmHandler);
function cmHandler(){
        trace("menu open");
}
var item1=new ContextMenuItem("item 1", itemHandler);
item1.value=1;
cm.customItems.push(item1);
function itemHandler(obj, item){
        trace("item value: "+item.value);
}
this.menu=cm;

On 12/8/06, Marc Hoffman <[EMAIL PROTECTED]> wrote:
Not sure why you'd need to pass parameters, since the context menu is
established by your code and doesn't allow sub-menus (from what I've
read). Whatever parameter you need to pass, I assume it's a result of
something else happening in the movie, so why not store it in a
variable in the movie and then access it as part of the function
_test? If the parameter varies depending where the user right-clicks,
you'd need a new context menu for that area of the stage, or you
could evaluate where the mouse cursor is and use that to generate the
parameter. If you need variations on the function from a single
context menu, just create more custom items (up to 15 are allowed).

Or am I missing something?

Marc Hoffman

At 12:38 PM 12/7/2006, you wrote:

>Hi!
>I have this code:
>var cm:ContextMenu = new ContextMenu();
>cm.hideBuiltInItems();
>cm.customItems.push(new ContextMenuItem("My menu", _test));
>my_dg["menu"] = cm;//my_dg is an data grid component
>
>How i can pass parameters to function _test


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



--
/*
Bored, sometimes.
*/
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to