Forse vuoi fare qualcosa così:
codice:function openURL(btn, item) { getURL(item.url, "_blank"); } function setItemCommand(btn, tle, url) { var menu_cm = new ContextMenu(); var menu_it = new ContextMenuItem(tle, openURL); menu_it.url = url; menu_cm.customItems.push(menu_it); btn.menu = menu_cm; } setItemCommand(bottone_1, "Google", "http://www.google.com/"); setItemCommand(bottone_2, "Html.it", "http://www.html.it/"); setItemCommand(bottone_2, "Altavista", "http://www.altavista.it/");

Rispondi quotando